Coder Social home page Coder Social logo

Comments (5)

ahihi avatar ahihi commented on July 18, 2024

ok, i got a little suspicious about the single broken WAV i have in my library, pointed out in the message:

WARNING: File reading failed for path: '/Users/ahihi/SyncBig/sc/dirt/samples/nab/narayanbreikki-129.wav'

i removed it, and sure enough, the code now works as expected... i still don't understand why or how it fails completely on what should be just a warning though. maybe memory corruption?

in case anyone wants to experiment with this, the broken file is available here: https://owo.uwu.fi/narayanbreikki-129.wav

from superdirt.

telephon avatar telephon commented on July 18, 2024

The error message is really strange indeed, I also don't understand how ~dirt could become nil as a buffer loading fails.
I wonder if it would be better to really throw errors when something like file reading goes wrong, instead of just warning. @yaxu what do you think?

from superdirt.

ahihi avatar ahihi commented on July 18, 2024

i am trying to add some of my own WAV metadata parsing to latest develop and seeing this weird behavior again - SuperDirt object looks fine inside the function that sets it up, but becomes nil when returned to the caller. im at a complete loss on how to debug this..

from superdirt.

telephon avatar telephon commented on July 18, 2024

SuperDirt object looks fine inside the function that sets it up, but becomes nil when returned to the caller.

You mean after your set up, ~dirt == nil?

from superdirt.

ahihi avatar ahihi commented on July 18, 2024

yes, very similar situation to the original post. in fact i noticed i had a new invalid wav file in my library and that was again causing the problem.

so i looked into the error handling a bit and after a lot of confusing experimentation i noticed that this line in readWithInfo probably should be prefixed with a ^? it seems the intention is to return nil on failure, but the current code returns a Buffer with nil members which has just been freed. this sus buffer passes the notNil check and i guess something breaks down the line.

i added that ^ and now the ~dirt returned by my function looks fine even with the invalid file causing a read fail warning! (i prefer this behavior over throwing)

also, this try seems wrong (no catch function, tryed function takes an error arg?) but im not sure whether it affects any of the above.

anyway, yay progress! :) i can test a bit more and make a PR later this week.

from superdirt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.