Summary


This hour took what you learned in the previous hour about digital sound and gave it a practical face. More specifically , you learned how to play wave sounds using a high-level Win32 API function called PlaySound() . Although this function certainly has its limitations, you can't beat it when it comes to sheer simplicity; a single line of code is all it takes to play a wave sound. You found out how to play wave sounds from a file or as a resource, as well as how to play looped wave sounds and how to stop a sound once it has started playing.

You might be wondering about the fact that this hour focused solely on sampled digital audio, as opposed to MIDI music. The playback of wave sounds is in fact dramatically different than the playback of MIDI music at the programming level, which is why this hour dodged the topic of playing MIDI music. However, the next hour digs right into the playback of MIDI music, and how to add music to games .



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