Namespace: AudioManager

AudioManager

The static class that handles BGM, BGS, ME and SE.

Members

AudioManager.bgmVolumenumberstatic

The volume of the BGM audio

AudioManager.bgsVolumenumberstatic

The volume of the BGS audio

AudioManager.meVolumenumberstatic

The volume of the ME audio

AudioManager.seVolumenumberstatic

The volume of the SE audio

Methods

AudioManager.audioFileExt()stringstatic

Returns the file extension to use for audio files
Returns:
TypeDescription
stringThe file extension to use for audio files

AudioManager.checkErrors()static

Checks if any buffers could not load their audio file

AudioManager.cleanupSe()static

Removes any SE buffers that are not currently playing

AudioManager.createBuffer(folder, name)WebAudiostatic

Creates a WebAudio buffer from the file found at the folder and filename location given
NameTypeDescription
folderstringThe folder to find the audio file
namestringThe name of the audio file (not including file extension)
Returns:
TypeDescription
WebAudioA WebAudio buffer object

AudioManager.fadeInBgm(duration)static

Fades in the current BGM
NameTypeDescription
durationnumberHow long the fade in effect lasts (in seconds)

AudioManager.fadeInBgs(duration)static

Fades in the current BGS
NameTypeDescription
durationnumberHow long the fade in effect lasts (in seconds)

AudioManager.fadeOutBgm(duration)static

Fades out the current BGM
NameTypeDescription
durationnumberHow long the fade out effect lasts (in seconds)

AudioManager.fadeOutBgs(duration)static

Fades out the current BGS
NameTypeDescription
durationnumberHow long the fade out effect lasts (in seconds)

AudioManager.fadeOutMe(duration)static

Fades out the current ME
NameTypeDescription
durationnumberHow long the fade out effect lasts (in seconds)

AudioManager.isCurrentBgm(bgm)static

Checks if the given bgm is currently playing
NameTypeDescription
bgmObjectcompares the bgm name to currently playing bgm name

AudioManager.isCurrentBgs(bgs)static

Checks if the given bgs is currently playing
NameTypeDescription
bgsObjectcompares the bgs name to currently playing bgs name

AudioManager.isStaticSe(se)static

Checks if the given SE is a static SE by name
NameTypeDescription
seObjectthe se object to compare

AudioManager.loadStaticSe(se)static

Creates a buffer and pushes it to the static se buffer stack
NameTypeDescription
seObjectthe se object to load

AudioManager.makeEmptyAudioObject()Objectstatic

Creates an empty audio object
Returns:
TypeDescription
ObjectAn empty audio object with an empty string name, 0 volume and 0 pitch

AudioManager.playBgm(bgm, pos)static

Plays the BGM beginning at a position in the file
NameTypeDescription
bgmObjectthe bgm object to play
posnumberposition in the audio file to start at

AudioManager.playBgs(bgs, pos)static

Plays the BGS beginning at a position in the file
NameTypeDescription
bgsObjectthe bgs object to play
posnumberposition in the audio file to start at

AudioManager.playMe(me)static

Plays the given ME.
NameTypeDescription
meObjectthe me object to play

AudioManager.playSe(se)static

Plays the given SE.
NameTypeDescription
seObjectthe se object to play

AudioManager.playStaticSe(se)static

Plays the given static SE. Static SEs do not stop when stopSe is called.
NameTypeDescription
seObjectthe se object to play

AudioManager.replayBgm(bgm)static

Replays the given bgm from where it's last position was
NameTypeDescription
bgmObjectthe bgm object to replay

AudioManager.replayBgs(bgs)static

Replays the given bgs from where it's last position was
NameTypeDescription
bgsObjectthe bgs object to replay

AudioManager.saveBgm()Objectstatic

Saves the currently playing BGM
Returns:
TypeDescription
ObjectThe currently playing BGM, or an empty audio object is no current BGM exists

AudioManager.saveBgs()Objectstatic

Saves the currently playing BGS
Returns:
TypeDescription
ObjectThe currently playing BGS, or an empty audio object is no current BGS exists

AudioManager.stopAll()static

Stops ME, SE, BGM, and BGS

AudioManager.stopBgm()static

Stops playing the current BGM

AudioManager.stopBgs()static

Stops playing the current BGS

AudioManager.stopMe()static

Stops playing the current ME

AudioManager.stopSe()static

Stops all SEs that are currently playing

AudioManager.throwLoadError(webAudio)static

Throws an error screen with retry button if audio file could not be loaded.
NameTypeDescription
webAudioWebAudioThe buffer that could not be loaded.
Throws:
Will throw a retry screen error

AudioManager.updateBgmParameters(bgm)static

Updates BGM parameters: volume, pitch, and pan
NameTypeDescription
bgmObjectbgm object to update parameters from

AudioManager.updateBgsParameters(bgs)static

Updates BGS parameters: volume, pitch, and pan
NameTypeDescription
bgsObjectbgs object to update parameters from

AudioManager.updateBufferParameters(buffer, configVolume, {{volume:)static

Updates a buffer's parameters for volume, pitch, and pan from a given audio object
NameTypeDescription
bufferWebAudioThe WebAudio buffer to update
configVolumenumberThe volume setting from the player's audio settings
{{volume:number, pitch: number, pan: number} audio - The audio object to update volume, pitch, and pan from

AudioManager.updateCurrentBgm(bgm, pos)static

Updates the currently playing BGM's volume, pitch, pan, pos, and name
NameTypeDescription
bgmObjectbgm object to set as the current bgm
posnumberposition in the audio file to begin playing from

AudioManager.updateCurrentBgs(bgs, pos)static

Updates the currently playing BGS's volume, pitch, pan, pos, and name
NameTypeDescription
bgsObjectbgs object to set as the current bgs
posnumberposition in the audio file to begin playing from

AudioManager.updateMeParameters(me)static

Updates ME parameters: volume, pitch, and pan
NameTypeDescription
meObjectme object to update parameters from

AudioManager.updateSeParameters(buffer, se)static

Updates SE parameters: volume, pitch, and pan
NameTypeDescription
bufferWebAudiothe se buffer to update
seObjectse object to update parameters from