No Game Engine Game Dev: Word Sleuth 102: Which sounds are mu-law encoded and decoding QOI images

2 months ago
5

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

Game Engines are for sissies!

Yesterday we made it possible to set a given audio file to have different encodings and numbers of channels. Today I coded into the Sandbox a way to run through every sound in the game and play/stop it. I set every sound to mono channel and mu-law encoded. Then I scanned through every sound file and listened to it. If it had audio artifacts I marked it back to PCM encoding. A couple of rounds of testing later and all the sounds are reasonably good quality while cutting my embedded audio data to about 25% of the original size (down to about 1 million lines of audio data in my code file instead of 4 million).

After that I started trying to code up QOI image file processing. It has a single page specification and is very straightforward. Even if the compression isn't as good as PNG or JPEG, the simplicity is a reasonable tradeoff for me with this project. I downloaded some example files from the QOI webpage, read the specification and went to work. I got to where we read the file and generated the expected number of pixels in the resulting image. I copy/pasted some code to write that data out as uncompressed BMP to verify. It isn't right yet, but with some debugging tomorrow I think we'll get it.

Loading 1 comment...