YourGameLib
Loading...
Searching...
No Matches
Functions
yourgame::audio Namespace Reference

audio playback related functions More...

Functions

int init (int numSources, int numChannels=0, int sampleRate=0)
 initialize audio
 
void shutdown ()
 shutdown audio
 
bool isInitialized ()
 check if audio initialized
 
int storeFile (const std::string &filename)
 load and store audio file
 
int play (const std::string &filename, bool loop=false)
 play audio file, that was previously loaded via storeFile()
 
int stop (int sourceId)
 stop audio source
 
int pause (int sourceId, bool pause)
 pause/unpause audio source
 
int setChannelGains (int sourceId, const std::vector< float > &gains)
 set gain per channel of an audio source
 

Detailed Description

audio playback related functions

Function Documentation

◆ init()

int yourgame::audio::init ( int  numSources,
int  numChannels = 0,
int  sampleRate = 0 
)

initialize audio

◆ isInitialized()

bool yourgame::audio::isInitialized ( )

check if audio initialized

◆ pause()

int yourgame::audio::pause ( int  sourceId,
bool  pause 
)

pause/unpause audio source

Parameters
sourceIdaudio source id
pausetrue: pause, false: unpause
Returns
int

◆ play()

int yourgame::audio::play ( const std::string &  filename,
bool  loop = false 
)

play audio file, that was previously loaded via storeFile()

Parameters
filename
loop
Returns
int audio source id

◆ setChannelGains()

int yourgame::audio::setChannelGains ( int  sourceId,
const std::vector< float > &  gains 
)

set gain per channel of an audio source

Parameters
sourceIdaudio source id
gainsgain [0.0 .. 1.0] per channel
Returns
int

◆ shutdown()

void yourgame::audio::shutdown ( )

shutdown audio

◆ stop()

int yourgame::audio::stop ( int  sourceId)

stop audio source

Parameters
sourceIdaudio source id
Returns
int

◆ storeFile()

int yourgame::audio::storeFile ( const std::string &  filename)

load and store audio file