Skip to content

brAudio is a lightweight Audio Engine designed specifically for use in video game applications. It is build on top of the FMOD core API and has support for Audio Sources, Audio Groups and 3D Audio.

Notifications You must be signed in to change notification settings

alejandrodlsp/brAudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Breath Audio

brAudio is a lightweight audio library I wrote for my game engine (In progress). It is built on top of FMOD audio. This is my first time writting an audio engine, this is not a finished robust product.

Support

  • Sound loading and streaming
  • Audio sources with media control
  • 3D audio
  • Audio groups
  • Pitch and volume control

TODO

  • Sound effects
  • Reverb zones
  • Premake support for project generation
  • Multiple audio listener support
  • Integrate with brMath

Examples

Load sounds

// Load sound as a stream
Sound streamedSound("res/sound/birds.mp3", true);
// Load sound 
Sound loadedSound("res/sound/birds.mp3", false);

Creating an Audio Source

// Create audio source (sound, volume, pitch, looping)
AudioSource backgroundSource(&streamedSound, 1.0f, 1.0f, true);

Manage an audio source

// Play audio source
backgroundSource.Play();

// Control audio source
backgroundSource.Pause();
backgroundSource.Mute(true);
backgroundSource.Resume();

// Set audio source parameters
backgroundSource.Set3DPosition({ 1.0, 0.0, 1.0 });
backgroundSource.SetPitch(0.5f);
backgroundSource.SetVolume(0.5f);

// Change source's sound
backgroundSource.SetActiveSound(&loadedSound);

Create and assign an Audio Group

AudioGroup masterGroup; // Master group
AudioGroup sfxGroup(masterGroup); // Audio group child of master group
backgroundSource.SetAudioGroup(sfxGroup);

Manage an audio group

sfxGroup->SetVolume(0.5f);
sfxGroup->SetPitch(0.5f);
sfxGroup->Mute(true);

Update audio listener every frame, and cleanup afterwards

while(true)
{
    float elapsed = 0;
    AudioListener::GetInstance()->Update(elapsed);
}

// Clean-up
AudioListener::GetInstance()->ReleaseSystem();

About

brAudio is a lightweight Audio Engine designed specifically for use in video game applications. It is build on top of the FMOD core API and has support for Audio Sources, Audio Groups and 3D Audio.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published