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 . |