AudioManager Class - NocturnalWisp/Tynted-Engine GitHub Wiki

Load Audio

Summary
Loads an audio into the manager to be playable.

Implementation

AudioManager.LoadAudio(string filePath, string audioName, bool shortTime)

Vars

  • filePath - The path to the audio file.
  • audioName - The name of the audio to be accessed later when controlling a specific audio file.
  • shortTime - Determines whether it should be stored in RAM (true), or streamed from the file (false).

Play Audio

Summary
Plays the specified audio file.

Implementation

AudioManager.PlayAudio(string audioName, bool loop)

Vars

  • audioName - The name of the audio to find and play.
  • loop - Whether to loop the audio or not.

Stop Audio

Summary
Stops the specified audio file.

Implementation

AudioManager.StopAudio(string audioName)

Vars

  • audioName - The name of the audio to find and stop.

Set Volume

Summary
Sets the volume of the specified audio file.

Implementation

AudioManager.SetVolume(string audioName, float volume)

Vars

  • audioName - The name of the audio.
  • volume - The new volume of the audio (0-100)

Get Volume

Summary
Gets the volume of the specified audio file.

Implementation

AudioManager.GetVolume(string audioName)

Vars

  • audioName - The name of the audio.

Returns

  • float - The volume of the audio file.