• Advertisement
Sign in to follow this  

playing a .wav with sdl

This topic is 4428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to add support for sound in my game so I added this piece of code:
[sourcecpp]
 // Load in sound effects
                  
                  Mix_Chunk *ping;
                  Mix_Chunk *score;
                  ping = Mix_LoadWAV("sound/ping.wav");
                  score = Mix_LoadWAV("sound/score.wav"); 
Now what would I use to play back the .wav files. Is it Play_Chunk or something along those lines?. I have sdl_mixer installed. Thank you so much.

Share this post


Link to post
Share on other sites
Advertisement
No, it is not Play_Chunk. It is Read_Documentation :-) I found this one especially useful.

After browsing it you should notice that Mix_PlayChannel can be used to play sounds ;-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement