scott created page: JoeyLib Sound Functions
parent
45d3f11f94
commit
bc9c08d6ca
1 changed files with 56 additions and 0 deletions
56
JoeyLib-Sound-Functions.md
Normal file
56
JoeyLib-Sound-Functions.md
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
*At the moment, JoeyLib supports music in the Amiga MOD format. This may change to MIDI with instrument samples. Stay tuned!*
|
||||||
|
|
||||||
|
#### jlSoundFree
|
||||||
|
```c
|
||||||
|
void jlSoundFree(jlSoundT *sound);
|
||||||
|
```
|
||||||
|
Releases the memory used by `sound`.
|
||||||
|
|
||||||
|
#### jlSoundIsPlaying
|
||||||
|
```c
|
||||||
|
bool jlSoundIsPlaying(jlSoundT *sound);
|
||||||
|
```
|
||||||
|
Returns `true` if `sound` is currently playing on any channel.
|
||||||
|
|
||||||
|
#### jlSoundLoad
|
||||||
|
```c
|
||||||
|
bool _jlSoundLoad(jlSoundT sound, char *filename);
|
||||||
|
```
|
||||||
|
*(Note: This prototype isn't entirely accurate. No pointer crazyness is needed to pass the sound into this function.)* Returns `true` if the file `filename` was loaded into memory. The handle to the sound is allocated and returned as `sound`.
|
||||||
|
|
||||||
|
#### jlSoundMusicContinue
|
||||||
|
```c
|
||||||
|
void jlSoundMusicContinue(void);
|
||||||
|
```
|
||||||
|
Resumes music playback if it was previously paused.
|
||||||
|
|
||||||
|
#### jlSoundMusicIsPlaying
|
||||||
|
```c
|
||||||
|
bool jlSoundMusicIsPlaying(void);
|
||||||
|
```
|
||||||
|
Returns `true` if music is currently being played.
|
||||||
|
|
||||||
|
#### jlSoundMusicPause
|
||||||
|
```c
|
||||||
|
void jlSoundMusicPause(void);
|
||||||
|
```
|
||||||
|
Pauses the music if it is currently being played.
|
||||||
|
|
||||||
|
#### jlSoundMusicPlay
|
||||||
|
```c
|
||||||
|
void jlSoundMusicPlay(char *name);
|
||||||
|
```
|
||||||
|
Loads and plays `name`. Since the actual format of the music data varies on different platforms, do not specify a filename extension for `name`.
|
||||||
|
|
||||||
|
#### jlSoundMusicStop
|
||||||
|
```c
|
||||||
|
void jlSoundMusicStop(void);
|
||||||
|
```
|
||||||
|
Stops any currently playing music and releases the memory it occupied.
|
||||||
|
|
||||||
|
#### jlSoundPlay
|
||||||
|
```c
|
||||||
|
void jlSoundPlay(jlSoundT *sound);
|
||||||
|
```
|
||||||
|
Plays a previously loaded `sound` on the first available channel. If all channels are currently in use, the request to play the sound is ignored.
|
||||||
|
|
Loading…
Add table
Reference in a new issue