bn::sound_handle class

Sound effect handle.

Public functions

auto id() const -> int
Returns the internal id.
auto active() const -> bool
Indicates if this sound effect is active or not.
auto item() const -> sound_item
Returns the sound_item of this sound effect.
void stop()
Stops playback of this sound effect.
void release()
Marks this sound effect as unimportant. This enables the sound effect to be interrupted by music and other sound effects if the need arises.
auto speed() const -> fixed
Returns the playback rate of this sound effect.
void set_speed(fixed speed)
Sets the playback rate of this sound effect.
auto panning() const -> fixed
Returns the panning level of this sound effect.
void set_panning(fixed panning)
Sets the panning level of this sound effect.

Function documentation

void bn::sound_handle::release()

Marks this sound effect as unimportant. This enables the sound effect to be interrupted by music and other sound effects if the need arises.

The handle will be invalidated after calling this method.

void bn::sound_handle::set_speed(fixed speed)

Sets the playback rate of this sound effect.

Parameters
speed Playback rate, in the range [0..64].

void bn::sound_handle::set_panning(fixed panning)

Sets the panning level of this sound effect.

Parameters
panning Panning level, in the range [-1..1].