how can I manage to get Pure-Basic to play an audio file in the correct speed, if the sample rate of the audio file doesn't match the one used in the settings of the sound card?
Here is a snipped:
Code: Select all
initSound()
LoadSound(0, "audio.wav")
PlaySound(0)
Debug GetSoundFrequency(0)
Delay(5000)
- 16-bit signed integer
- PCM
- 48000 Hz
- Stereo
My sound card is system-widely set to 44100 Hz (the sample rate setting in PulseAudio). Everything else that has to do with audio, works great on my computer.
If I run the snipped, the file plays way too slow (actually at 44100 Hz instead of 48000 Hz). There is no real-time resampling. Instead of resampling, the file is just slowed don to 44100 Hz.
The audio file plays fine in all other players installed on the same system.
How do I play it at the correct speed?
I tried SetSoundFrequency(0,48000) but it did nothing?
The opposite method, GetSoundFrequency(), delivers -17536 (a negative value So it should play backwards... that is nonsence value )
Appendix: I'm on Linux Mint 18.1 (x64)