GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::audio::SoundStageOptions Struct Reference

Configuration options for a SoundStage. More...

#include <GREM/audio/SoundStage.hpp>

Public Attributes

size_t outputChannelCount = 2
 The number of output channels to produce audio for.
float outputVolume = 1.0f
 Global master output volume.
float speedOfSound = 343.3f
 The speed of sound in the sound stage.
size_t maxSimultaneousSoundInstanceCount = 128
 The maximum total number of sound instances that can play simultaneously.
bool useRoundoff = true
 Whether to use roundoff when clipping the audio samples sent to the output.
bool enableStatistics = false
 Whether to enable statistics gathering or not.

Detailed Description

Configuration options for a SoundStage.

Member Data Documentation

◆ outputChannelCount

size_t grem::audio::SoundStageOptions::outputChannelCount = 2

The number of output channels to produce audio for.

Must be 1 (mono), 2 (stereo), 4 (quad), 6 (5.1) or 8 (7.1).

◆ outputVolume

float grem::audio::SoundStageOptions::outputVolume = 1.0f

Global master output volume.

The amplitude of all playing sound is multiplied by this gain value, meaning that a value of 1 represents no change, i.e. 100% of the original volume.

◆ speedOfSound

float grem::audio::SoundStageOptions::speedOfSound = 343.3f

The speed of sound in the sound stage.

This value is used for doppler effect calculations and distance delay simulation.

Note
The default value assumes that any coordinates passed to the sound stage are expressed in meters, and that the sound stage environment is dry air at around 20 degrees Celsius.

◆ maxSimultaneousSoundInstanceCount

size_t grem::audio::SoundStageOptions::maxSimultaneousSoundInstanceCount = 128

The maximum total number of sound instances that can play simultaneously.

If the number of playing sounds exceeds this number, the ones with the highest volume will be picked to actually play.

◆ useRoundoff

bool grem::audio::SoundStageOptions::useRoundoff = true

Whether to use roundoff when clipping the audio samples sent to the output.

When true, loud audio spikes are rounded off, which prevents clipping artifacts but may cause a slight quality degradation.

When false, audio samples are simply clamped to the output range, which may cause unpleasant clipping artifacts whenever samples go out of range.

◆ enableStatistics

bool grem::audio::SoundStageOptions::enableStatistics = false

Whether to enable statistics gathering or not.

Statistics gathering must be enabled in order for calculateOutputFastFourierTransformStatistics(), getOutputWaveStatistics() and getOutputChannelVolumeStatistics() to work.


The documentation for this struct was generated from the following file: