The static class that handles BGM, BGS, ME and SE.
Members
- The volume of the BGM audio
- The volume of the BGS audio
- The volume of the ME audio
- The volume of the SE audio
Methods
- Returns the file extension to use for audio files
Returns:
Type Description string The file extension to use for audio files - Checks if any buffers could not load their audio file
- 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
Name Type Description folderstring The folder to find the audio file namestring The name of the audio file (not including file extension) Returns:
Type Description WebAudio A WebAudio buffer object - Fades in the current BGM
Name Type Description durationnumber How long the fade in effect lasts (in seconds) - Fades in the current BGS
Name Type Description durationnumber How long the fade in effect lasts (in seconds) - Fades out the current BGM
Name Type Description durationnumber How long the fade out effect lasts (in seconds) - Fades out the current BGS
Name Type Description durationnumber How long the fade out effect lasts (in seconds) - Fades out the current ME
Name Type Description durationnumber How long the fade out effect lasts (in seconds) - Checks if the given bgm is currently playing
Name Type Description bgmObject compares the bgm name to currently playing bgm name - Checks if the given bgs is currently playing
Name Type Description bgsObject compares the bgs name to currently playing bgs name - Checks if the given SE is a static SE by name
Name Type Description seObject the se object to compare - Creates a buffer and pushes it to the static se buffer stack
Name Type Description seObject the se object to load - Creates an empty audio object
Returns:
Type Description Object An empty audio object with an empty string name, 0 volume and 0 pitch - Plays the BGM beginning at a position in the file
Name Type Description bgmObject the bgm object to play posnumber position in the audio file to start at - Plays the BGS beginning at a position in the file
Name Type Description bgsObject the bgs object to play posnumber position in the audio file to start at - Plays the given ME.
Name Type Description meObject the me object to play - Plays the given SE.
Name Type Description seObject the se object to play - Plays the given static SE. Static SEs do not stop when stopSe is called.
Name Type Description seObject the se object to play - Replays the given bgm from where it's last position was
Name Type Description bgmObject the bgm object to replay - Replays the given bgs from where it's last position was
Name Type Description bgsObject the bgs object to replay - Saves the currently playing BGM
Returns:
Type Description Object The currently playing BGM, or an empty audio object is no current BGM exists - Saves the currently playing BGS
Returns:
Type Description Object The currently playing BGS, or an empty audio object is no current BGS exists - Stops ME, SE, BGM, and BGS
- Stops playing the current BGM
- Stops playing the current BGS
- Stops playing the current ME
- Stops all SEs that are currently playing
- Throws an error screen with retry button if audio file could not be loaded.
Name Type Description webAudioWebAudio The buffer that could not be loaded. Throws:
Will throw a retry screen error - Updates BGM parameters: volume, pitch, and pan
Name Type Description bgmObject bgm object to update parameters from - Updates BGS parameters: volume, pitch, and pan
Name Type Description bgsObject bgs object to update parameters from - Updates a buffer's parameters for volume, pitch, and pan from a given audio object
Name Type Description bufferWebAudio The WebAudio buffer to update configVolumenumber The 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 - Updates the currently playing BGM's volume, pitch, pan, pos, and name
Name Type Description bgmObject bgm object to set as the current bgm posnumber position in the audio file to begin playing from - Updates the currently playing BGS's volume, pitch, pan, pos, and name
Name Type Description bgsObject bgs object to set as the current bgs posnumber position in the audio file to begin playing from - Updates ME parameters: volume, pitch, and pan
Name Type Description meObject me object to update parameters from - Updates SE parameters: volume, pitch, and pan
Name Type Description bufferWebAudio the se buffer to update seObject se object to update parameters from