ABSTRACT

Every sound that might be heard is associated with a Virtual Voice object. Since these can stop or change state at any time, they are indirectly but efficiently accessed via “smart pointers,” preventing references to stale data. This central chapter introduces short snippets of C++ code which fit together to implement key aspects of the audio runtime system described.

Each Virtual Voice has 17 public properties and 20 more “private” ones used to implement it. This chapter lists those and describes what they’re for from the points of view of both programmers and sound designers.

Concepts: how voices, groups, listeners and outputs fit together, virtual Voice priorities and their interpretation, sample and stream initialisation structures, bulk initialisation with the default voiceintegrity protection with the dummy voice, methods to play, stop, replace and chain together samples and streams, loops and one-shot sound behaviour compared, smart-pointer implementation of Virtual Voice handles in C++,error reporting, profiling and logging recommendations, automatic voice fading, upwards, downwards and to stop in C++, turning audio off without wasting memory or recompiling, physical voice counts tabulated for eight PC and console games.