vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::VoiceParams Struct Reference

Everything the mixer needs to know about one voice, pushed every frame. More...

#include <audio_device.h>

Public Member Functions

float heardMinDistance () const
 The near distance as the mixer takes it.
float heardMaxDistance () const
 The far distance as the mixer takes it.
bool hasFar () const
 Whether the voice fades with distance and so has a range past which it is silent.

Public Attributes

float volume = 1.0f
 Linear gain for this voice, multiplied into the master.

Detailed Description

Everything the mixer needs to know about one voice, pushed every frame.

A snapshot rather than a component reference: the device must not know the ECS.

Member Function Documentation

◆ heardMinDistance()

float Vkm::Engine::VoiceParams::heardMinDistance ( ) const
inline

The near distance as the mixer takes it.

It is multiplied into the per-sample gain, so bad values are read as zero.

Returns
minDistance, or 0 where it is negative or not finite.

◆ heardMaxDistance()

float Vkm::Engine::VoiceParams::heardMaxDistance ( ) const
inline

The far distance as the mixer takes it.

Returns
maxDistance, or 0 where it is negative or not finite.

◆ hasFar()

bool Vkm::Engine::VoiceParams::hasFar ( ) const
inline

Whether the voice fades with distance and so has a range past which it is silent.

Returns
true when the far distance opens past the near one.

Member Data Documentation

◆ volume

float Vkm::Engine::VoiceParams::volume = 1.0f

Linear gain for this voice, multiplied into the master.

Negative and non-finite values are heard as silence, since one infinite gain would take the whole mix non-finite.


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