We have discussed the current (messy) state of audio on the web and have looked at the audio libraries available to Emscripten. I mentioned a few places where you can get free sound effects. We created a simple audio application using C and Emscripten that allowed us to play a series of audio files. We then added sound effects to our game, which included explosion and laser sounds. We modified our initialization code inside the main() function to initialize the SDL Audio subsystem. We added a new Shoot function to be used by our spaceships when they shoot projectiles. We also created a new Audio class to help us play our audio files.
In the next chapter, we will learn how we can add some physics to our game.