Audio#
Contains functions related to sfx and music.
Access with Audio->
.
Variables#
int |
|
const int |
|
int[] |
Volume deprecated |
int |
|
bool[] |
Functions#
void |
PlaySound(int sfx) |
void |
EndSound(int sfx) |
void |
PauseSound(int sfx) |
void |
ResumeSound(int sfx) |
void |
ContinueSound(int sfx) |
void |
AdjustMusicVolume(int percent) |
void |
AdjustSFXVolume(int percent) |
void |
|
void |
|
void |
PlayMIDI(int midi) |
bool |
PlayEnhancedMusic(char32[] filename, int track = |
void |
AdjustSound(int id, int volume, int pan = |
bool |
PlayOgg(int arg1, int arg2) deprecated |
int |
|
void |
SetMusicPos(int pos) |
void |
SetMusicSpeed(int speed) |
int |
|
void |
SetMusicLoop(int start, int end) |
void |
PlaySoundEx(int id, int volume, int pan = |
int |
GetSoundCompletion(int sfx) |
bool |
CrossfadeEnhancedMusic(char32[] filename, int track, int fadeoutframes, int fadeinframes, int delayframes = |
Variable descriptions#
The audio panning style. Use the PAN_
constants for this value.
Warning
Deprecated! Use AdjustMusicVolume() or AdjustSFXVolume() instead.
Controls how often the engine refreshes the currently playing music while warping.
bool[] MusicRefreshFlags 🔗 Source
A set of flags for handling extra effects on MusicRefresh.
Function descriptions#
void PlaySound(int sfx) 🔗 Source
Plays the quest SFX sfx
.
void EndSound(int sfx) 🔗 Source
If sfx
is playing, immediately stop it.
void PauseSound(int sfx) 🔗 Source
If sfx
is playing, pause it (so that it may be resumed later).
void ResumeSound(int sfx) 🔗 Source
Resume sfx
from where it was paused.
void ContinueSound(int sfx) 🔗 Source
Resume sfx
from where it was paused.
void AdjustMusicVolume(int percent) 🔗 Source
Adjusts a multiplier for the volume of all MIDI, DIGI, and Enhanced Music.
void AdjustSFXVolume(int percent) 🔗 Source
Adjusts a multiplier for the volume of all Sound Effects (WAV).
void PauseCurMIDI() 🔗 Source
Pauses the currently playing MIDI so that it may be resumed later.
void ResumeCurMIDI() 🔗 Source
Resumes the previously paused MIDI.
void PlayMIDI(int midi) 🔗 Source
Plays the MIDI midi
. Will revert upon changing screens.
bool PlayEnhancedMusic(char32[] filename, int track = 0
) 🔗 Source
Play the specified enhanced music if available. If the music cannot be played, the current music will continue. Reverts to normal upon leaving the screen.
Returns true if the music file was loaded successfully.
filename
cannot be more than 255 characters.
If the music format does not support multiple tracks, track
is ignored.
void AdjustSound(int id, int volume, int pan = 0
, long freq = -1L
, bool loop_sfx = false
) 🔗 Source
Change properties on a currently playing sound.
bool PlayOgg(int arg1, int arg2) 🔗 Source
Warning
Deprecated! Use PlayEnhancedMusic() instead!
Returns the current seek position of the currently playing enhanced music in seconds.
CURRENTLY ONLY SUPPORTS MP3 / OGG / IT / XM / S3M / MOD
void SetMusicPos(int pos) 🔗 Source
Sets the position for the currently playing enhanced music, in seconds.
CURRENTLY ONLY SUPPORTS MP3 / OGG / IT / XM / S3M / MOD
void SetMusicSpeed(int speed) 🔗 Source
Sets the playback speed of the currently playing enhanced music.
CURRENTLY ONLY SUPPORTS MP3 / OGG / IT / XM / S3M / MOD
int GetMusicLength() 🔗 Source
Returns the length of the current playing enhanced music in seconds.
CURRENTLY ONLY SUPPORTS MP3 / OGG / IT / XM / S3M / MOD
void SetMusicLoop(int start, int end) 🔗 Source
Loops the currently playing enhanced music between two timestamps in seconds.
CURRENTLY ONLY SUPPORTS MP3 / OGG / IT / XM / S3M / MOD
void PlaySoundEx(int id, int volume, int pan = 0
, long freq = -1L
, bool loop_sfx = false
) 🔗 Source
Plays the quest SFX sfx
but with different properties.
int GetSoundCompletion(int sfx) 🔗 Source
Returns a rough completion percentage (0-100) for how much of a sound has played.
bool CrossfadeEnhancedMusic(char32[] filename, int track, int fadeoutframes, int fadeinframes, int delayframes = 0
, int startpos = 0
) 🔗 Source
Crossfade to the specified enhanced music if available. If the music cannot be played, the current music will continue.
Reverts to normal upon leaving the screen.
Returns true if loaded successfully.
filename
cannot be more than 255 characters.
Currently only supports MP3 / OGG / IT / XM / S3M / MOD.