Sound Class Reference

#include <Sound.h>

Description

Module that handles all audio related functionality.

Static Functions

static bool IsPlaying (AssetID index)
 
static ActiveSound PlayAudio (AssetID, uint8_t effectChannel=0, float volume=1.f, float panning=.5f)
 

Channels

All audio plays through a number of Channels. Think of a channel as a set of independent audio systems: each channel can have its own set of effects applied to it, can have a specific volume applied, or panning applied. A common set up would be to have a separate channel for Sound Effects, a separate channel for "Background Music", and perhaps another for "Voice Audio".

AudioEffects are functors that process and modify raw audio data. AudioEffects are ran on each sample that is played on its owning channel. AudioEffects are ran on samples before it is passed to the mixer for processing.

In the case that effect processing is desired for all samples, It is possible to add / remove effects to / from the mixer directly via the MasterEffect functions.

static void ChannelAddEffect (const AudioEffect *, uint8_t channel)
 
static void ChannelRemoveEffect (const AudioEffect *, uint8_t channel)
 
static void ChannelReset (uint8_t channel)
 
static void ChannelKeepAwake (uint8_t, bool doIt)
 
static void ChannelSetVolume (uint8_t channel, float)
 
static void ChannelSetPanning (uint8_t channel, float)
 
static AudioManager * GetManager ()
 
std::string GetName ()
 
void Init ()
 
void InitAfter ()
 
void RunBefore ()
 
void RunAfter ()
 
void DrawBefore ()
 
void DrawAfter ()
 
BackendGetBackend ()
 

Member Function Documentation

static bool IsPlaying ( AssetID  index)
static

Returns whether or not an instance of the sample is playing.

static ActiveSound PlayAudio ( AssetID  ,
uint8_t  effectChannel = 0,
float  volume = 1.f,
float  panning = .5f 
)
static

Queues audio for immediate playback.

Parameters
effectChannelThe channel to send the audio block to play on.
panningThe panning for the sound. 0.f is all the way to the left, 1.f is all the way to the right
volumeThe volume the sound should play at.
static void ChannelAddEffect ( const AudioEffect ,
uint8_t  channel 
)
static

Registers an AudioEffect instance with an associated effect channel. All further samples that play on the given channel will have this effect applied.

static void ChannelRemoveEffect ( const AudioEffect ,
uint8_t  channel 
)
static

Unregisters an AudioEffect instance.

static void ChannelReset ( uint8_t  channel)
static

Removes all effects from a channel. This does not delete the AudioEffects given to the channel.

static void ChannelKeepAwake ( uint8_t  ,
bool  doIt 
)
static

Keeps the stream active for the given channel. By default, channels will only be active if there are samples playing through it This is normally fine, execpt this means effects will stop once no samples are being processed through a channel. For something like reverberation, this would cut off meaningful information from being output. Keeping the channel awake sacrifices performance for making more quality.

static void ChannelSetVolume ( uint8_t  channel,
float   
)
static

Sets the volume for the given channel 0.f denotes minimum volume and 1.f maximum. The values are clipped if they are beyond these bounds.

static void ChannelSetPanning ( uint8_t  channel,
float   
)
static

Sets the panning for the entire channel. 0.f denotes all the way to the left and 1.f all the way to the right. The values are clipped if they are beyond these bounds.

static AudioManager* GetManager ( )
static

}


The documentation for this class was generated from the following file:
  • /home/jc/git/Dynacoe/DynacoeSrc/includes/Dynacoe/Modules/Sound.h