DevBlog 21 - Writing a simple Audio System in OpenAL

Published April 04, 2022
Advertisement




Adding audio to my engine.

I used OpenAL as the API is similar to OpenGL, the graphics API of this project.

I've added sounds to ship engines, lasers, explosions, UI, and more.

OpenAL makes Doppler effects easy, it just works out of the box.

I know there isn't sound in space, but I'm take a more stylized approach and wanted sounds.

I also made the audio system work with time dilation.

We can scale the pitch of audio by the current time dilation factor.

This has the effect of making the sounds sound deeper in slowmo, and higher in fast speed.

I created the entire system with a top down approach.

To know how it works, you can to the AudioSystem::tickAudioPipeline function.

I also created some debugging tools.

You can enable a cheat that creates visual shapes at emitter locations.

This can be used to get an idea of what is causing a sound and where it is at.

I also created conditional logging that can be used to track emitter states.

This type of logging was perhaps the most useful in diagnosing problems.

I showcase my new audio system in action then give a high level overview of the c++ code

0:00 Demoing the Audio System

1:07 Time Dilation Demo

1:31 System c++ Overview

6:40 Useful Audio System Debugging Tips

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement