No Game Engine Game Dev: Word Sleuth 101: Supporting multiple audio options (channels and encodings)

4 days ago
1

Streamed on 2024-12-17 (https://www.twitch.tv/thediscouragerofhesitancy)

Game Engines are for sissies!

It looks like we have to accept that some files sound fine with mu-law encoding and some do not. As a compromise between audio quality and size, we should support multiple encodings. So that's what we worked on.

I coded things up to have mu-law/mono audio sounding normal again. Then I added more configuration options to each sound file in the EmbedWAVs code. Each file now specifies its encoding and channels. I verified by looking at the output size and things look okay from that perspective. Then I added the functionality to EmbedWAVs to store and lookup the encoding and channels per sound.

With the asset pipeline side of things done, I move to the in-game code for playing Sounds. It looks up the encoding and channel count from the SoundWarehouse where that information was embedded by the sound asset pipeline. A few if statements and function or two later and it can now play back different options on a per sound basis. Now we can decide which files to use mu-law encoding for and which to use 16 bit PCM for. Yeah us!

Loading comments...