-
Notifications
You must be signed in to change notification settings - Fork 15
Symphony Audio Engine
Twarit Waikar edited this page Aug 6, 2018
·
4 revisions
The Rubeus Engine's audio engine, named as 'Symphony' uses SFML's Audio components as its backend. Symphony's workflow is a hybrid of the OpenGL state machine workflow and SFML's sound buffer loading and cueing.
Usage in C++:
- Symphony manages two different types of audio tracks.
- Sound tracks:
- Used for loading short sounds like walking effects, or weapon action sound effects.
- Music tracks:
- Used for longer pieces of audio like ambient music and background music.
- Each type of track lists are currently supporting 20 tracks each.
- Sound tracks:
- The sound manager needs to know what is the minimum number of tracks you want to play your first piece of audio on. To add a music track, use
RSymphony::addMusicTrack(int)
to add the specified number of music tracks to use. - Next, specify which track do you want to load your sound file to. A summary of steps so far are given below.
RSymphony * audio_manager = new RSymphony();
audio_manager->addMusicTrack(1);
audio_manager->addSoundTrack(1);
audio_manager->loadTrack(MUSIC_TRACK, TRACK_0, "Assets/bgmusic.wav", 20 , true);
// trackName , track #, sound file path , volume, set looping
audio_manager->loadTrack(SOUND_TRACK, TRACK_0, "Assets/footsteps.wav", 10);
- Use
playTrack()
to cue music
audio_manager->playTrack(MUSIC_TRACK, TRACK_0);
audio_manager->playTrack(SOUND_TRACK, TRACK_0);
Project maintained by SDSLabs