🔊 AUDIO#
Note
ANTIRUINS supports various audio formats for different use cases.
Audio Type#
ANTIRUINS supports the following audio types:
audio.SFX
#
Used for short sound samples, one shots, etc. The sound is loaded directly in memory.
Must be a .wav file under 65k samples. Can be any sample rate between 8khz and 41 kHz, stero or mono.
audio.WAV
#
Used for audio streaming. Must be a .wav file.
audio.CDDA
#
Used for CDDA audio streaming. Must be a 16-bit 44100 kHz .wav file.
Note
CDDA files must be places in the music folder. You need to add them to the config.lua file.
Source#
local source = {
loaded = false,
id = 0,
channel = -1,
volume = 220, -- 0 to 254
isPlaying = false,
type = audio.SFX,
}
Loads a .wav file. Returns a source.
Type must be audio.SFX, audio.WAV, or audio.CDDA.
Plays a source.
OPTIONAL: If
volume
is set, it will override the source volume.OPTIONAL: If
loop
is true, the audio will loop.
Sets the volume of a playing source.
Frees the memory of a loaded source.
Returns true if the source is currently playing.
Pauses the playback of a source.
Stops the playback of a source.
Sets the pan. 128 is center, 0 is full left, 255 is full right.
Only works on SFX type sound.