[SDL] Still problems to play soundfiles

Tyler Montbriand tsm at accesscomm.ca
Sat Nov 15 11:07:01 PST 2003


On Saturday 15 November 2003 12:10 pm, Hauke J. Zuehl wrote:
> Hi!
>
> I still have problems to play a raw audio file.
>
> This is my code:
> -------------- snip ---------------------------
>   Sound_AudioInfo *WantedSpec_HZ;
>   Sound_Sample  *sample;
>
>   Sound_Init();
>
>   WantedSpec_HZ           =
> (Sound_AudioInfo*)malloc(sizeof(Sound_AudioInfo));
>   WantedSpec_HZ->rate     = 44100;
>   WantedSpec_HZ->format   = AUDIO_U16MSB;
>   WantedSpec_HZ->channels = 1;
>
>   sample =
> Sound_NewSampleFromFile(UserSystemPtr->Sfx.SampleSlots[Pos_HZ],
> WantedSpec_HZ, 8192);
>   Sound_DecodeAll(sample);
>   Sound_FreeSample(sample);
>   Sound_Quit();
> ------------------- snip ---------------
> A soundfile can be downloaded on
> http://athene.dnsalias.org/MausKlick.raw.gz
> The file is a 16 bit sound file in big-endian format (created on an
> Amiga).
>
> Currently I get no errors with the code above but I cannot hear any
> noise :(
> I think it is yet not necessary to turn big-endian into little-endian
> because I just want to hear a kind of noise.
>
> So I hope someone can give me a hint.
>
> Thanks and regards,
> Hauke

You will need to specify the RAW decoder explicitly.  It is not used unless 
you force it to be used, because there is no way to autodetect RAW audio.




More information about the SDL mailing list