Audio

Overview

Audio in the engine is managed by Cry Audio::IAudioSystem, an abstraction layer allowing for the playback of audio through any audio middleware such as FMOD Studio and WWise. This allows mapping the middleware setup to an engine setup in the Audio Tool in the Editor, resulting in types we can query to play back audio at run-time.

Although using the audio system directly for playback of audio is possible, entities provide IEntityAudioComponent as a way of handling audio that is automatically set to follow the entities’ position changes and properties.

Listeners

Listeners are typically automated with camera placement, in order to receive audio from the rendered location. Listeners are represented by the CryAudio::IListener interface, and can be created using CryAudio::IAudioSystem::CreateListener. Once created, each listener's world-space transformation can be updated with CryAudio::IListener::SetTransformation.

Note that listener handling is automated by the Listener Component in the default components plug-in, see Cry::Audio::DefaultComponents::CListenerComponent. In addition, the Camera Component will automatically add a listener component that will match its transformation.

Triggers

Represented by the CryAudio::Impl::ITrigger interface internally, Triggers are merely containers that execute all controls that are connected to them. Any number of connections can be grouped into a single trigger. Triggers can be executed with the IEntityAudioComponent::ExecuteTrigger function.

Parameters

Represented by the CryAudio::Impl::IParameter interface internally, Parameters are used to seamlessly alter a parameter's value on which the Audio Middleware can receive and drive corresponding effects. Parameters can be set using the IEntityAudioComponent::SetParameter function.

Switches and States

Switches can contain any number of states which can be set via code or Flow Graph. An example of a popular switch would be the surface type for character footsteps. The state of a switch can be set with the IEntityAudioComponent::SetSwitchState function.

Preloads

Preloads are requests to load audio specific files into memory. Any number of files can be grouped into a single request, avoiding disk reads at run-time.

Environments

Environments define areas that drive effects such as reverb or weapon reflections. Represented by the CryAudio::Impl::IEnvironment interface,

Conclusion

This concludes the article on audio, you may be interested in: