Index: audio/MPEGaudio.cpp =================================================================== --- audio/MPEGaudio.cpp (revision 370) +++ audio/MPEGaudio.cpp (working copy) @@ -25,6 +25,7 @@ #include "MPEGaudio.h" #include "MPEGstream.h" +#include MPEGaudio:: MPEGaudio(MPEGstream *stream, bool initSDL) : sdl_audio(initSDL) { @@ -53,6 +54,9 @@ samplesperframe *= 3; } } + if (wanted.freq < 44100) { + samplesperframe *= (int)ceil(44100.0/wanted.freq); + } if ( sdl_audio ) { /* Open the audio, get actual audio hardware format and convert */ bool audio_active; Index: audio/mpegtoraw.cpp =================================================================== --- audio/mpegtoraw.cpp (revision 370) +++ audio/mpegtoraw.cpp (working copy) @@ -338,7 +338,22 @@ *(--out) = *in; } } - + + /* convert fmt */ + if(rawdatawriteoffset) { + SDL_AudioSpec spec; + SDL_AudioCVT cvt; + WantedSpec(&spec); + SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq, spec.format, spec.channels, 44100); + cvt.buf = (Uint8 *)malloc(rawdatawriteoffset*2*cvt.len_mult); + memcpy(cvt.buf, rawdata, rawdatawriteoffset*2); + cvt.len = rawdatawriteoffset*2; + SDL_ConvertAudio(&cvt); + memcpy(rawdata, cvt.buf, cvt.len_cvt); + rawdatawriteoffset = cvt.len_cvt >> 1; + free(cvt.buf); + } + // Sam 10/5 - If there is no data, don't increment frames if ( rawdatawriteoffset ) { ++decodedframe;