bn::sound namespace
#include <bn_sound.h>

Sound effects related functions.

Contents

Functions

void play(sound_item item)
Plays the sound effect specified by the given sound_item with default settings.
void play(sound_item item, fixed volume)
Plays the sound effect specified by the given sound_item.
void play(sound_item item, fixed volume, fixed speed, fixed panning)
Plays the sound effect specified by the given sound_item.
void play_with_priority(int priority, sound_item item)
Plays the sound effect specified by the given sound_item with default settings and the given priority.
void play_with_priority(int priority, sound_item item, fixed volume)
Plays the sound effect specified by the given sound_item with the given priority.
void play_with_priority(int priority, sound_item item, fixed volume, fixed speed, fixed panning)
Plays the sound effect specified by the given sound_item with the given priority.
void stop_all()
Stops all sound effects that are being played currently.

Function documentation

void bn::sound::play(sound_item item)

Plays the sound effect specified by the given sound_item with default settings.

Default settings are volume = 1, speed = 1 and panning = 0.

void bn::sound::play(sound_item item, fixed volume)

Plays the sound effect specified by the given sound_item.

Parameters
item Specifies the sound effect to play.
volume Volume level, in the range [0..1].

void bn::sound::play(sound_item item, fixed volume, fixed speed, fixed panning)

Plays the sound effect specified by the given sound_item.

Parameters
item Specifies the sound effect to play.
volume Volume level, in the range [0..1].
speed Playback rate, in the range [0..64].
panning Panning level, in the range [-1..1].

void bn::sound::play_with_priority(int priority, sound_item item)

Plays the sound effect specified by the given sound_item with default settings and the given priority.

Parameters
priority Priority relative to backgrounds in the range [-32767..32767].
item Specifies the sound effect to play.

If there's playing too much sound effects at the same time, sound effects with higher priorities are discarded later.

Default settings are volume = 1, speed = 1 and panning = 0.

void bn::sound::play_with_priority(int priority, sound_item item, fixed volume)

Plays the sound effect specified by the given sound_item with the given priority.

Parameters
priority Priority relative to backgrounds in the range [-32767..32767].
item Specifies the sound effect to play.
volume Volume level, in the range [0..1].

If there's playing too much sound effects at the same time, sound effects with higher priorities are discarded later.

void bn::sound::play_with_priority(int priority, sound_item item, fixed volume, fixed speed, fixed panning)

Plays the sound effect specified by the given sound_item with the given priority.

Parameters
priority Priority relative to backgrounds in the range [-32767..32767].
item Specifies the sound effect to play.
volume Volume level, in the range [0..1].
speed Playback rate, in the range [0..64].
panning Panning level, in the range [-1..1].

If there's playing too much sound effects at the same time, sound effects with higher priorities are discarded later.