SDL Digest, Vol 46, Issue 4

Hi Nikos,
I tried your sample .wav files. 8, 11, 22, 44, 48, and 96 play
correctly for me. 16 and 32 play incorreclty. They don’t sound at
all like the music played at a different speed; they sound like an
electric pop followed by a bunch of white noise. I have SDL changeset
4881 and SDL_mixer changeset 490.–
Terry Welsh
mogumbo ‘at’

Message: 6
Date: Sat, 02 Oct 2010 05:08:25 +0300
From: Nikos Chantziaras
To: sdl at
Subject: Re: [SDL] SDL_mixer plays 22kHz WAV files at double speed
Message-ID: <i8646p$vpp$1 at>
Content-Type: text/plain; charset=“iso-8859-1”; Format=“flowed”

Oopsy, they’re 16kHz files, not 22kHz (those play correctly). Rates
that don’t play correctly are 96, 48, 32, 16 and 8.

The only rates that do play correctly are 44.1, 22.05 and 11.025.

I need to be able to play them all though :-/ (The app in question is
an open source Unix port of a Windows game engine that runs already
existing games, which already include any of the above rates for WAV files.)

SDL 1.2.14, SDL_mixer 1.2.11. x86-64. Gentoo Linux.

I am attaching a test program and put a sample WAV file in all the above
mentioned sample rates here:

On 10/01/2010 07:07 PM, Felipe wrote:

What version of SDL and SDL_Mixer are you using? Can you post a
complete example to reproduce the problem (with the sound where the
buffer came from)?

On Fri, Oct 1, 2010 at 8:49 AM, Nikos Chantziaras wrote:


SDL_RWops* rw = SDL_RWFromConstMem(dataBuf, size);
Mix_Chunk* chunk = Mix_LoadWAV_RW(rw, 1);

where ‘dataBuf’ contains 22kHz of “Microsoft WAV audio” data, results in
’chunk’ sounding like a chipmunk when it’s played (it’s played back at

Is there a way to avoid this?
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl_sound-bug.c
Type: text/x-c
Size: 875 bytes
Desc: not available