BelaPlatform / Bela

Bela: core code, IDE and lots of fun!
Other
490 stars 139 forks source link

fft-phase-vocoder cannot find sample.wav ? #26

Closed giuliomoro closed 8 years ago

giuliomoro commented 8 years ago

despite the file is actually there where it looks for it (so maybe it is an error while reading it)!

giuliomoro commented 8 years ago

It is due to the fact that, in the libsndfile docs: http://www.mega-nerd.com/libsndfile/api.html#open

When opening a file for read, the format field should be set to zero before calling sf_open(). The only exception to this is the case of RAW files where the caller has to set the samplerate, channels and format fields to valid values. All other fields of the structure are filled in by the library.

SO, sfopen.format needs to be initialized to zero.