ssfrr / AudioIO.jl

[UNMAINTAINED] - Simple Audio IO in Julia
MIT License
61 stars 24 forks source link

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

Open jfsantos opened 10 years ago

jfsantos commented 10 years ago

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.