AudioIO.jl icon indicating copy to clipboard operation
AudioIO.jl copied to clipboard

Playing a file with a sample rate != 44100 does not work

Open jfsantos opened this issue 11 years ago • 0 comments

I am trying to play a file with a sample rate of 16 kHz (using data = open('"myfile16khz.wav"); play(data), but it fails with the following exception:

WARNING: Audio Task died with exception: ErrorException("assertion failed: node.file.sfinfo.samplerate == info.sample_rate")

Apparently, the default stream for playing files and arrays is always opened considering a sampling rate of 44100 Hz, but that's not always the case. When you play a file, I think it should use the sampling rate of the file, and for arrays, you should be able to pass the sampling rate as a parameter.

If someone can give me a clue on how I could do this, I'll be happy to submit a pull request implementing this behavior.

jfsantos avatar Nov 03 '14 02:11 jfsantos