Introduction
In this chapter, you'll learn how to use the sound subsystem in LuaSDL and to communicate over the network or between the threads with the ZeroMQ library.
Sounds and music in games can enhance the overall atmosphere or make them even more memorable to players. The LibSDL library itself contains only the basic function to send raw data to your audio card. Fortunately, the LuaSDL library bundles the LibSDL library with the SDL_Mixer add-on, which extends a number of audio file decoders and adds simple audio effects, such as volume control, fade-in, and fade-out. You can load sound samples by using one of these file formats: WAV, MID, MOD, OGG, or MP3.
Whether or not you plan to use multiplayer, the ZeroMQ library can solve many common problems with network communication or multithreading.
This library provides a robust yet simple communication system. It supersedes classic socket connections with reliable message transport and automatic reconnection. Optionally, connections can be...