Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: AudioPlaySdRaw samples seem to play at (approx) half speed

  1. #1

    AudioPlaySdRaw samples seem to play at (approx) half speed

    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.

  2. #2
    Junior Member
    Join Date
    Dec 2016
    Location
    France, Bordeaux
    Posts
    8
    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.

  3. #3
    Quote Originally Posted by Jat View Post
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •