Skip to content

AmplimixLayer

class AmplimixLayer

A single layer in the mixer.

A mixer layer is a container for audio data and associated properties. Each layer is linked to a single SoundInstance, and manage its life cycle inside Amplimix.

See
Amplimix

Functions

Name Description
~AmplimixLayer Default destructor.
GetId Gets the unique identifier of the layer.
GetStartPosition Gets the start position of the audio data in the layer.
GetEndPosition Gets the end position of the audio data in the layer.
GetCurrentPosition Gets the current position of the audio data in the layer.
GetGain Gets the final gain of the audio data in the layer.
GetStereoPan Gets the stereo pan of the audio data in the layer.
GetPitch Gets the pitch of the audio data in the layer.
GetObstruction Gets the obstruction amount of the audio data in the layer.
GetOcclusion Gets the occlusion amount of the audio data in the layer.
GetPlaySpeed Gets the play speed of the audio data in the layer.
GetLocation Gets the location of the audio data in the layer.
GetEntity Gets the entity associated with the audio data in the layer.
GetListener Gets the listener currently rendering the audio data in the layer.
GetRoom Gets the room in which the audio data in the layer is currently located.
GetChannel Gets the channel managing the audio data in the layer.
GetBus Gets the bus on which the audio data in the layer is playing.
GetSoundFormat Gets the sound format of the audio data in the layer.
GetSpatialization Gets the spatialization mode of the audio data in the layer.
IsLoopEnabled Checks if the audio data in the layer is looping.
IsStreamEnabled Checks if the audio data in the layer is streaming from the file system.
GetSound Gets the sound associated with the audio data in the layer.
GetEffect Gets the effect associated with the audio data in the layer.
GetAttenuation Gets the attenuation associated with the audio data in the layer.
GetSampleRate Gets the current sample rate of the audio data in the layer.

Function Details

GetAttenuation

* GetAttenuation() const

Gets the attenuation associated with the audio data in the layer.

Return
The attenuation associated with the audio data in the layer.
See
Attenuation

GetBus

virtual Bus GetBus() const = 0

Gets the bus on which the audio data in the layer is playing.

Return
The bus on which the audio data in the layer is playing.
See
Bus

GetChannel

virtual Channel GetChannel() const = 0

Gets the channel managing the audio data in the layer.

Multiple layers can be linked to the same Channel.

Return
The channel managing the audio data in the layer.
See
Channel

GetCurrentPosition

virtual AmUInt64 GetCurrentPosition() const = 0

Gets the current position of the audio data in the layer.

This position is in samples, not bytes. It represents the current offset from the start of the linked sound data, where the mixer is currently playing audio.

Return
The current playback position of the audio data in the layer.

GetEffect

* GetEffect() const

Gets the effect associated with the audio data in the layer.

Return
The effect associated with the audio data in the layer.
See
EffectInstance, Effect

GetEndPosition

virtual AmUInt64 GetEndPosition() const = 0

Gets the end position of the audio data in the layer.

This position is in samples, not bytes. It represents the offset from the start of the linked sound data, where the mixer should stop playing audio.

Return
The end position of the audio data in the layer.

GetEntity

virtual Entity GetEntity() const = 0

Gets the entity associated with the audio data in the layer.

Return
The entity associated with the audio data in the layer. If the layer is not associated with an Entity, an invalid entity is returned.
See
Entity

GetGain

virtual AmReal32 GetGain() const = 0

Gets the final gain of the audio data in the layer.

Return
The final gain of the audio data in the layer.

GetId

virtual AmUInt32 GetId() const = 0

Gets the unique identifier of the layer.

Return
The unique identifier of the layer.

GetListener

virtual Listener GetListener() const = 0

Gets the listener currently rendering the audio data in the layer.

Return
The listener currently rendering the audio data in the layer. If the layer is not associated with a Listener, an invalid listener is returned.
See
Listener

GetLocation

virtual AmVec3 GetLocation() const = 0

Gets the location of the audio data in the layer.

The location is expressed as a 3D vector in the global space. For sound instances linked to an Entity, the location of that entity is returned instead.

Return
The location of the audio data in the layer.
See
Entity

GetObstruction

virtual AmReal32 GetObstruction() const = 0

Gets the obstruction amount of the audio data in the layer.

This value is useful only when the layer is associated with a sound instance that has spatialization enabled. You can update this value using the SetObstruction method from the Entity this layer is associated with.

Return
The obstruction amount of the audio data in the layer.
See
Entity

GetOcclusion

virtual AmReal32 GetOcclusion() const = 0

Gets the occlusion amount of the audio data in the layer.

This value is useful only when the layer is associated with a sound instance that has spatialization enabled. You can update this value using the SetOcclusion method from the Entity this layer is associated with.

Return
The occlusion amount of the audio data in the layer.
See
Entity

GetPitch

virtual AmReal32 GetPitch() const = 0

Gets the pitch of the audio data in the layer.

This value is affected by the Doppler effect. A value of 1.0 will play the audio data at its original pitch, while any value greater than 1.0 will increase the pitch, and any value less than 1.0 will decrease the pitch.

Return
The pitch of the audio data in the layer.

GetPlaySpeed

virtual AmReal32 GetPlaySpeed() const = 0

Gets the play speed of the audio data in the layer.

This values affects the final pitch.

Return
The play speed of the audio data in the layer.

GetRoom

virtual Room GetRoom() const = 0

Gets the room in which the audio data in the layer is currently located.

Return
The room in which the audio data in the layer is currently located. If the layer is not located in a Room, an invalid room is returned.
See
Room

GetSampleRate

virtual AmUInt32 GetSampleRate() const = 0

Gets the current sample rate of the audio data in the layer.

The current sample rate of the audio data in the layer can be different from the original sample rate stored in the sound format. Its value may change due to the Doppler effect, or due to an internal sample rate conversion to match the one specified in the loaded engine configuration.

Return
The current sample rate of the audio data in the layer.

GetSound

* GetSound() const

Gets the sound associated with the audio data in the layer.

Return
The sound associated with the audio data in the layer.
See
Sound

GetSoundFormat

virtual SoundFormat GetSoundFormat() const = 0

Gets the sound format of the audio data in the layer.

The sound format specifies the number of channels, sample rate, and other audio properties. It is filled by the Codec that handled the decoding of the audio data.

Return
The sound format of the audio data in the layer.
See
SoundFormat, Codec

GetSpatialization

virtual eSpatialization GetSpatialization() const = 0

Gets the spatialization mode of the audio data in the layer.

The spatialization mode determines how the audio data in the layer is processed to produce a stereoscopic sound. This value must be set in the asset file of the sound object.

Return
The spatialization mode of the audio data in the layer.
See
eSpatialization

GetStartPosition

virtual AmUInt64 GetStartPosition() const = 0

Gets the start position of the audio data in the layer.

This position is in samples, not bytes. It represents the offset from the start of the linked sound data, where the mixer should start playing audio.

Return
The start position of the audio data in the layer.

GetStereoPan

virtual AmReal32 GetStereoPan() const = 0

Gets the stereo pan of the audio data in the layer.

The stereo pan of the audio data in the layer is a value between -1.0 (left) and 1.0 (right). A value of -1.0 will render the audio data to the left speaker, a value of 1.0 will render the audio data to the right speaker, and a value of 0.0 will render the audio data to the center speaker.

Return
The stereo pan of the audio data in the layer.

IsLoopEnabled

virtual bool IsLoopEnabled() const = 0

Checks if the audio data in the layer is looping.

Return
true if the audio data in the layer is looping, false otherwise.

IsStreamEnabled

virtual bool IsStreamEnabled() const = 0

Checks if the audio data in the layer is streaming from the file system.

Return
true if the audio data in the layer is streaming from the file system, false otherwise.

~AmplimixLayer

virtual ~AmplimixLayer() = default

Default destructor.