[SDL] SDL_svg has born!

Enzo enzogupi at interfree.it
Fri Nov 28 05:38:01 PST 2003


Hi David :)

Am Mit, 2003-11-12 um 08.42 schrieb David Olofson:

> Well, that's probably because a "raw audio file" could be pretty much 
> anything. There's no way to tell what a raw file is, or what endian 
> it is, or anything else by that name, or by looking at the file; it's 
> just plain raw data.
> 

Hmmm....

> 
> Anyway, assuming they're 16 bit big endian files (mono or stereo 
> doesn't matter) and you want 16 bit little endian, just load the file 
> and then go through the buffer swapping bytes. Something like this 
> should do:
> 
> void flip_endian(Uint8 *data, int length)

Okay...we have such a function in our project :)

> (From "simplemixer" at http://olofson.net/examples.html)
> 

Good to know :)

> 
> BTW, how are you doing the mixing; custom code, SDL_mixer, or 
> something else? Keep in mind that if you want your code to be 
> portable, you most probably want to leave the data as is if you 
> compile for a big endian system.
> 

Well, I use SDL_MixAudio to mix the sounds.

The code I use can be found on
http://athene.dnsalias.org/~hauke/SfxSound.txt
(Comments are written in German)

A short description:
We have arrays to store the name of the soundfile (just to know what
sound we want to play).
Then I prepare the spec structure with needed data, load the WAV, store
the callback function and opens audio.

That's all but no sound :(

Regards,
Hauke
-- 
Aus Ben Hur (1959): Wer nicht fuer Rom ist, ist gegen Rom
George W. Bush (2002): Wer nicht fuer uns ist, ist gegen uns





More information about the SDL mailing list