Audio in SDL

Are there anyone out there, knowing any tutorials or examples regarding
the use of .WAV or .MP3 in SDL? I’ve come up with simple games, but
want to add music to them…since I’m pretty much a newbie, I haven’t
been able to work it out. Could anyone help?

Regards
/Mancunian

i dont know if you’d want to use mp3 in a game since the licence for mp3 is
somewhat questionable… perhaps you should look into ogg instead :slight_smile:

/ chrisse (open source/formats enthusiast)On ons, mar 28, 2001 at 08:36:32 +0200, Markus Larsson wrote:

regarding the use of .WAV or .MP3 in SDL?

Speaking of formats; does anyone know if there is an actual implementation of
wavelet based video compression around?

I’m thinking about something that operates in 3D (2D + time), compressing key
frames as 2D arrays and then defining the time between the key frames as a
higher degree (ie not linear or cubic) “morphing” function.

It was discussed on the Lionhead board a good while ago, but I don’t think
anyone got around to implement it… I will, eventually, unless someone beats
me to it, and concludes that it’s a useless algorithm. :slight_smile:

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Wednesday 28 March 2001 10:43, Christoffer Gurell wrote:

On ons, mar 28, 2001 at 08:36:32 +0200, Markus Larsson wrote:

regarding the use of .WAV or .MP3 in SDL?

i dont know if you’d want to use mp3 in a game since the licence for mp3 is
somewhat questionable… perhaps you should look into ogg instead :slight_smile:

/ chrisse (open source/formats enthusiast)

It’s not implemented yet, but there’s an Ogg project called 'tarkin’
looking into it.

See http://www.xiph.org/archives/ for the tarkin-dev list.

-dwh-On Wed, 28 Mar 2001, David Olofson wrote:

On Wednesday 28 March 2001 10:43, Christoffer Gurell wrote:

On ons, mar 28, 2001 at 08:36:32 +0200, Markus Larsson wrote:

regarding the use of .WAV or .MP3 in SDL?

i dont know if you’d want to use mp3 in a game since the licence for mp3 is
somewhat questionable… perhaps you should look into ogg instead :slight_smile:

/ chrisse (open source/formats enthusiast)

Speaking of formats; does anyone know if there is an actual implementation of
wavelet based video compression around?

I’m thinking about something that operates in 3D (2D + time), compressing key
frames as 2D arrays and then defining the time between the key frames as a
higher degree (ie not linear or cubic) “morphing” function.

It was discussed on the Lionhead board a good while ago, but I don’t think
anyone got around to implement it… I will, eventually, unless someone beats
me to it, and concludes that it’s a useless algorithm. :slight_smile:

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -’

regarding the use of .WAV or .MP3 in SDL?

i dont know if you’d want to use mp3 in a game since the licence for mp3
is
somewhat questionable… perhaps you should look into ogg instead :slight_smile:

There are no software patents in europe :stuck_out_tongue: (and we all hope it’ll stay like
this…)

Now, serious, SDL_mixer
(http://www.libsdl.org/projects/SDL_mixer/index.html) is pretty much
self-explaining. You can use it for wave, midi, mp3, some mod and also ogg
vorbis files.
If you’re using windows, also take a look at
http://pygame.seul.org/ftp/win32-dependencies.zip , it contains all the
libraries you’ll need in precompiled form (saves compiling time).

You can get the specs from SDL_mixer.h; you’ll need Mix_OpenAudio,
Mix_LoadWAV, Mix_PlayChannel, Mix_FreeChunk and Mix_CloseAudio for a start.

HTH> On ons, mar 28, 2001 at 08:36:32 +0200, Markus Larsson wrote:

regarding the use of .WAV or .MP3 in SDL?
Now, serious, SDL_mixer
self-explaining. You can use it for wave, midi, mp3, some mod and also ogg
vorbis files.

Specifically, grab the source for SDL_Mixer and smpeg. SDL_Mixer has a
sample program called “playwave” and smpeg has one called “plaympeg”.–

Olivier A. Dagenais - Software Architect and Developer

Are there anyone out there, knowing any tutorials or examples regarding
the use of .WAV or .MP3 in SDL? I’ve come up with simple games, but
want to add music to them…since I’m pretty much a newbie, I haven’t
been able to work it out. Could anyone help?

To play WAVs, use SDL_Mixer… it’s the easiest way. :slight_smile:
For MP3s, use SMPEG with SDL_Mixer… it’s the easiest way. :wink:

-bill!