Chapter 9
Audio and Other Cool Game Programming Stuff
WHAT’S IN THIS CHAPTER?
- Learning how to use the low-level OpenAL APIs and the high-level audio APIs of this book’s SDK
- Learning how to use the OGG Vorbis file format
- Handling ambient and positional sounds
- Decompressing an audio stream into another thread for real-time playback
- Handling an OpenAL listener and linking it to your camera
- Implementing and using color picking
- Linking shaders and dynamically loading a GFX shader file directly from an .mtl file
- Creating an accelerometer camera and player controls
- Animating textures and adding mist to hide the far clipping plane
This chapter mainly covers the audio aspect of your games. Since implementing audio is relatively short and easy, this chapter will walk the extra mile and introduce you to other useful techniques for your “daily game programming needs.”
You will first discover how to initialize and use the low-level APIs of OpenAL. You will learn about the different types of sound sources and sound buffers, and will implement two basic, practical programs that will give you a good overview of the capabilities of OpenAL, using at first a raw sound file.
This chapter will also teach you how to create other thread(s) and use this separate process(es) to decompress in real time, sync, and queue multiple sound buffer chunks attached to a single sound source.
Moving on through this chapter, you will then crank it up by implementing a simple sound-based memory game using compressed ...