SDL_mixer examples?

Hi there,

I wondered if anyone knew of examples showing SDL_mixer being used to
mix sounds?

The included examples [playmus, playwave] don’t seem to show playing
more than one
sound at a time, and so I’m not quite sure what is covered and what is
not.
For example, do I have to process Mix_Chunks directly?

I’ll try some experiments of my own, of course, but am interested in
knowing how
this stuff is meant to be used before deciding for sure to use it…

Sorry if I’ve missed something obvious here…!

Tom Gilbert
http://www.AlteredWorlds.com

OK, it looks like I did miss the obvious here.
It seems that:
(i) background music track is always referred to by commands including
’Music’
loaded via Mix_LoadMUS returning a Mix_Music*
(ii) samples to mix are referred to as ‘chunks’ -
loaded via Mix_LoadWAV returning a Mix_Chunk*

Following this, all other commands are then pretty obvious…
For a moment I thought I had to divide my samples into multiple smaller
sections or ‘chunks’, work which I hoped the mixer would do for me, if
required!

thanks,

Tom Gilbert

Tom Gilbert wrote:>

Hi there,

I wondered if anyone knew of examples showing SDL_mixer being used to
mix sounds?

The included examples [playmus, playwave] don’t seem to show playing
more than one
sound at a time, and so I’m not quite sure what is covered and what is
not.
For example, do I have to process Mix_Chunks directly?

I’ll try some experiments of my own, of course, but am interested in
knowing how
this stuff is meant to be used before deciding for sure to use it…

Sorry if I’ve missed something obvious here…!

Tom Gilbert
http://www.AlteredWorlds.com

Hello,

For me, the mixer worked perfectly, just try this :

// declare sound

Mix_Chunk *sound;
// load wave
sound=Mix_LoadWAV(“test.wav”);
// set volume (1…255) (optional, default is 255)
Mix_VolumeChunk(sound,200);
// play wave, this mean, play sound on first avaible channal (-1) with
no loop (0)
Mix_PlayChannel(-1,sound,0);

Good luck

Stephane> Hi there,

I wondered if anyone knew of examples showing SDL_mixer being used to
mix sounds?

The included examples [playmus, playwave] don’t seem to show playing
more than one
sound at a time, and so I’m not quite sure what is covered and what is
not.
For example, do I have to process Mix_Chunks directly?

I’ll try some experiments of my own, of course, but am interested in
knowing how
this stuff is meant to be used before deciding for sure to use it…

Sorry if I’ve missed something obvious here…!

Tom Gilbert
http://www.AlteredWorlds.com

“Stephane Magnenat” wrote in message
news:001b01c00cda$e05dc760$0202a8c0 at K6450…

// play wave, this mean, play sound on first avaible channal (-1) with

no loop (0)
Mix_PlayChannel(-1,sound,0);

And here I’ve been manually looking for the first available channel. Why
doesn’t anybody tell me these things?–
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor