Mixer
Portable sound mixing library
Operations
FadeOutChannel
Gradually fade out which channel over ms milliseconds starting from now.
function : FadeOutChannel(which:Int, ms:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| which | Int | channel to fade out, or -1 to fade all channels out. |
| ms | Int | milliseconds of time that the fade-out effect should take to go to silence, starting now. |
Return
| Type | Description |
|---|---|
| Int | the number of channels set to fade out |
GetVolume
Gets the current volume
function : GetVolume(channel:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| channel | Int | Channel to set mix volume for. -1 will set the volume for all allocated channels. |
Return
| Type | Description |
|---|---|
| Int | current volume of the channel |
HaltChannel
Halt channel playback, or all channels
function : HaltChannel(channel:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| channel | Int | to stop playing, or -1 for all channels |
Return
| Type | Description |
|---|---|
| Int | always returns zero |
OpenAudio
Initialize the mixer API
function : OpenAudio(frequency:Int, format:Int, channels:Int, chunksize:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| frequency | Int | output sampling frequency in samples per second (Hz). you might use MIX_DEFAULT_FREQUENCY(22050) since that is a good value for most games. |
| format | Int | output sample format. |
| channels | Int | Number of sound channels in output. Set to 2 for stereo, 1 for mono. This has nothing to do with mixing channels. |
| chunksize | Int | bytes used per output sample. |
Return
| Type | Description |
|---|---|
| Bool | 0 on success, -1 on errors |