AudioPlaySdRaw samples seem to play at (approx) half speed

Status
Not open for further replies.

alialiali

Well-known member
Hi everyone, sorry to disturb you again, and sorry if any of this sounds silly, my understanding of audio is very weak...

I am using AudioPlaySdRaw to play raw files from the SD card. It seems to work very well but the samples seem to play at half speed. I did some experimenting on the conversion.

Wav file at bit rate 44100 -> Raw file at 44100 run at (approx, I haven't measured) half speed.
Wav file at bit rate 44100 -> Raw file at 16000 run at (approx) correct speed.

Am I on a wild goose chase, or should I use 16000 as the bitrate when converting? Here are my conversion command, using sox,

sox sounds/wavs/kick8.wav --bits 16 --encoding signed-integer --endian little --rate 44100 sounds/samples/kick8.raw #runs slow
sox sounds/wavs/kick8.wav --bits 16 --encoding signed-integer --endian little --rate 16000 sounds/samples/kick8.raw #runs about right

FWIW I did look at the code in AudioPlaySdRaw and saw a constant AUDIO_SAMPLE_RATE_EXACT / 2.0, so maybe the rate I am really looking for is 22050 ?

Again I am really not good at this stuff, so sorry anything I say sounds very silly, and as ever thanks for your help.
 
I got same issue on a project, for me it was the stereo Wav files not save as MONO raw, stereo raw have twice datas than mono... so half speed reading.
16bit 44100 -mono- raw work good by me. I use Audacity for samples editing.
Hope that help.
 
I got same issue on a project, for me it was the stereo Wav files not save as MONO raw, stereo raw have twice datas than mono... so half speed reading.
16bit 44100 -mono- raw work good by me. I use Audacity for samples editing.
Hope that help.

Amazing, thank you! I do believe that has solved it. For anyone using sox, that's just adding --channel 1 to the command line. Woohoo!
 
Status
Not open for further replies.
Back
Top