Go to the source code of this file.
|
#define | LGA_U_QT 0 |
|
#define | LGA_E_QT 1 |
|
#define | LGA_OPUS 0 |
|
#define | LGA_BGM 0 |
|
#define | LGA_BGS 1 |
|
#define | LGA_ME 2 |
|
#define | LGA_SE 3 |
|
#define | LGA_BGM_LOOP_START 0 |
| Specifies the start of the loop section in the BGM track in samples.
|
|
#define | LGA_GAIN 1 |
| Specifies the gain ("volume") with which a source should play.
|
|
|
void | lgaInit (int nbgmt, int nbgst, int nmet, int nset, int nbgss, int nses) |
| Initializes libgameaudio. More...
|
|
void | lgaProc (void) |
| Processes libgameaudio state. More...
|
|
void | lgaTerminate (void) |
| Terminates libgameaudio. More...
|
|
void | lgaSetParami (int id, int value) |
| Sets library parameters that modify how certain functions are performed. More...
|
|
void | lgaSetParamf (int id, float value) |
| Sets library parameters that modify how certain functions are performed. More...
|
|
void | lgaLoad (int audio_type, int format, const char *file) |
| Loads an audio track from an audio file. More...
|
|
void | lgaPlay (int audio_type, int tid, int sid) |
| Plays the the i-th track of an audio type. More...
|
|
void | lgaStop (int qt, int audio_type, int id) |
| Stops the playing BGM/ME track, if there is any. More...
|
|
◆ lgaInit()
void lgaInit |
( |
int |
nbgmt, |
|
|
int |
nbgst, |
|
|
int |
nmet, |
|
|
int |
nset, |
|
|
int |
nbgss, |
|
|
int |
nses |
|
) |
| |
Initializes libgameaudio.
Allocates memory for the specified number of tracks of each audio type and sources for each sound audio type.
- Parameters
-
nbgmt | Number of BGM tracks |
nbgst | Number of BGS tracks |
nmet | Number of ME tracks |
nset | Number of SE tracks |
nbgss | Number of BGS sources |
nses | Number of SE sources |
◆ lgaLoad()
void lgaLoad |
( |
int |
audio_type, |
|
|
int |
format, |
|
|
const char * |
file |
|
) |
| |
Loads an audio track from an audio file.
- Parameters
-
audio_type | Play type of the audio file. See Audio types |
format | Format of the audio file. See Audio formats |
file | Path to audio file |
◆ lgaPlay()
void lgaPlay |
( |
int |
audio_type, |
|
|
int |
tid, |
|
|
int |
sid |
|
) |
| |
Plays the the i-th track of an audio type.
Playing a BGM/BGS/ME track will stop the previously playing BGM/BGS/ME track, if there was any. Requests to play a SE will be ignored if there are no more available sources.
- Parameters
-
audio_type | Play type of the audio file. See Audio types |
tid | Track identifier. A track identifier is the order in which it was loaded with lgaLoad, e.g. if a track was loaded first its id is 0, if second 1 and so on. |
sid | Source identifier. Used to keep track on which source a BGS track is/should be played. Must be 0 in case of BGM/ME/SE |
◆ lgaProc()
Processes libgameaudio state.
This function mainly performs resource management, for example, given the limited amount of sound effect sources it frees up those sources that have already played their sound effect to play the next sound effect requests. It also does state management, such as making sure that the intro section of a BGM track is not played again.
- Attention
- This function must be called periodically, preferably every frame.
◆ lgaSetParamf()
void lgaSetParamf |
( |
int |
id, |
|
|
float |
value |
|
) |
| |
Sets library parameters that modify how certain functions are performed.
- Parameters
-
id | Parameter identifier. See Parameters |
value | Parameter value |
◆ lgaSetParami()
void lgaSetParami |
( |
int |
id, |
|
|
int |
value |
|
) |
| |
Sets library parameters that modify how certain functions are performed.
- Parameters
-
id | Parameter identifier. See Parameters |
value | Parameter value |
◆ lgaStop()
void lgaStop |
( |
int |
qt, |
|
|
int |
audio_type, |
|
|
int |
id |
|
) |
| |
Stops the playing BGM/ME track, if there is any.
- Parameters
-
qt | First-order logic quantifier |
audio_type | Play type of the audio file. See Audio types |
id | Source identifier. Must be 0 in case of BGM/ME/SE |
◆ lgaTerminate()
void lgaTerminate |
( |
void |
| ) |
|
Terminates libgameaudio.
Stops all audio playback and deallocates all tracks, sources, and buffers.