Audio - NocturnalWisp/Tynted-Engine GitHub Wiki

Getting Started

To handle audio in Tynted Engine, you need to use the Audio Manager class. The manager is actually quite simple. There are more functions then listed here, you can access them in the api.

Loading

To load an audio file into memory you utilize one function called LoadAudio. Do this inside your games initialize method.

//audioName is the name of the audio when you attempt to access it.
//short is a boolean to define if it is a short piece that can be played off the ram, 
//    otherwise it is streamed from the file.
AudioManager.LoadAudio(filePathWithExtension, audioName, short);

Playing and Pausing

You can play and pause an audio piece if you have it's name.

//Play audio.
AudioManager.PlayAudio(audioName, loop);
//Stop audio.
AudioManager.StopAudio(audioName);

Conclusion

The AudioManager class is helpful to playing audio for your user. You can load things often in the initialize function in your game/scene, then you play and stop whenever you like.