Studying Complex Game Systems Part 3: Audio Programming
- Jun 7, 2020
- 2 min read
Our next topic for Complex Games Systems was audio programming. As part of this topic we learnt about how audio is digitally stored. This process involves sampling multiple points along a sound wave, each sample being a value that represents the volume of a sound at a specific time. Sampling is done numerous times per second, and it’s important that as many samples are taken as possible in order to achieve the most accurate and high-quality depiction possible of a sound.
This led into the discussion of the differences between loading in and streaming a sound. When sound is loaded, it can be decompressed into memory as PCM (Pulse-code Modulation) or loaded into memory and decompressed at runtime. PCM transforms audio signals and waves into binary signals that are then prepared for transmission or processing.
When streaming a sound from an external source its decoded in real-time. For repetitive sound effects that don’t take up much space, loading them into memory is beneficial as they use up almost no CPU. Whereas for large audio files that may be used for music and dialogue, streaming is a viable solution as it takes up less memory. However, depending on the file format, streaming can take more CPU power and have a possible loss of quality.
An important aspect of creating an immersive environment within a game is the use of music and audio. The aim of sound design in games is to create dynamic audio that adapts to the various states of the game world. One way this is done is by using audio events that can come in many forms, including but not limited to the use of a weapon, player movement and collisions. Such events can be made more dynamic and interesting by randomising the audio that’s being played.
Another way that games can be made more immersive using audio, is by implementing sound propagation. Sound propagation is essentially the computation of the movement of sound waves through an environment. In games the implementation of sound propagation can provide realism and atmosphere. One method that is used to replicate realistic sound in a virtual environment, is ray tracing. Similar to the logic applied to achieving real-time global illumination, ray tracing uses the information gathered from ray to surface collisions and ray reflections to determine audio output. This means that the player would hear a sound differently depending on their distance from its source and surroundings in a virtual environment. Sound propagation and audio events are just two of many ways that audio can be used to enhance the player experience.
References:
Audio Programming Lecture
Audio Event Systems Lecture
Dictionary.com, 2020. Definition Of Pulse Code Modulation | Dictionary.Com. [online] www.dictionary.com. Available at: <https://www.dictionary.com/browse/pulse--code--modulation> [Accessed 27 May 2020].
Taylor, M., Chandak, A., Antani, L. and Manocha, D., 2010. Interactive Geometric Sound Propagation. [online] https://www.eetimes.com/. Available at: <https://www.eetimes.com/interactive-geometric-sound-propagation/> [Accessed 25 May 2020].



Comments