Hour 14. Playing Wave Sounds


Hour 14. Playing Wave Sounds

In the previous hour, you learned that digital sounds are called waves in Windows, and that they can be easily recorded and edited using a sound utility such as Sound Recorder, which ships with Windows. What you didn't learn was how to play wave sounds in the context of a game. This hour picks up where the previous hour left off by showing you exactly how to play wave sounds. You might be thinking that if wave sounds are anything like bitmaps, this hour will be fairly technical and include a lot of messy code for loading and interacting with wave data. You'll be glad to know that waves are actually quite easy to play, and adding wave sound effects to a game is unbelievably simple to do. This hour shows you how!

In this hour, you'll learn:

  • The two different ways to access wave sounds for playback

  • How to play wave sounds using the Win32 API

  • How to play a looped wave sound, and then stop it

  • How to incorporate wave sounds into an existing game



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net