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.
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: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.