Jump to content
  • Advertisement
Sign in to follow this  
SKATIN_HARD

playing a .wav with sdl

This topic is 4634 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!