ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
asw::sound::PlayOptions Struct Reference

Options for playing a sound. More...

#include <sound.h>

Collaboration diagram for asw::sound::PlayOptions:
[legend]

Public Attributes

float volume { 1.0F }
 Playback volume (0.0 - 1.0).
 
float pan { 0.0F }
 Panning (-1.0 left - 1.0 right). Ignored for positional sounds.
 
bool loop { false }
 Loop forever.
 
float pitch { 1.0F }
 Playback speed and pitch. 1.0 is normal, 2.0 is an octave up.
 
float pitch_variation { 0.0F }
 
float volume_variation { 0.0F }
 Random volume change per play, as a fraction.
 
Bus bus { Bus::Sfx }
 Bus to play on.
 
int priority { 0 }
 
float fade_in_s { 0.0F }
 Fade in time in seconds.
 
Attenuation attenuation {}
 Distance fall off, used by positional sounds.
 

Detailed Description

Options for playing a sound.

Definition at line 67 of file sound.h.

Member Data Documentation

◆ attenuation

Attenuation asw::sound::PlayOptions::attenuation {}

Distance fall off, used by positional sounds.

Definition at line 98 of file sound.h.

◆ bus

Bus asw::sound::PlayOptions::bus { Bus::Sfx }

Bus to play on.

Definition at line 88 of file sound.h.

◆ fade_in_s

float asw::sound::PlayOptions::fade_in_s { 0.0F }

Fade in time in seconds.

Definition at line 95 of file sound.h.

◆ loop

bool asw::sound::PlayOptions::loop { false }

Loop forever.

Definition at line 75 of file sound.h.

◆ pan

float asw::sound::PlayOptions::pan { 0.0F }

Panning (-1.0 left - 1.0 right). Ignored for positional sounds.

Definition at line 72 of file sound.h.

◆ pitch

float asw::sound::PlayOptions::pitch { 1.0F }

Playback speed and pitch. 1.0 is normal, 2.0 is an octave up.

Definition at line 78 of file sound.h.

◆ pitch_variation

float asw::sound::PlayOptions::pitch_variation { 0.0F }

Random pitch change per play, as a fraction. 0.05 picks between 0.95x and 1.05x. Stops repeated sounds (footsteps, hits) sounding robotic.

Definition at line 82 of file sound.h.

◆ priority

int asw::sound::PlayOptions::priority { 0 }

When every voice is busy, a new sound replaces the quietest voice with the same or lower priority. If there is none, the new sound is dropped.

Definition at line 92 of file sound.h.

◆ volume

float asw::sound::PlayOptions::volume { 1.0F }

Playback volume (0.0 - 1.0).

Definition at line 69 of file sound.h.

◆ volume_variation

float asw::sound::PlayOptions::volume_variation { 0.0F }

Random volume change per play, as a fraction.

Definition at line 85 of file sound.h.


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