Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Android Audio Woes

Last time, I reported that I was working on creating an Android build for testers for my second Freshly Squeezed Entertainment project called Clown Alley Creator, a creativity tool about creating your own fun clowns.

Sprints 2024-21: Android port for play testing

Completed:

  • Create Android port

At the end of the previous week, I had created an Android port that functioned but that was missing audio. Mostly.

As I suspected, I forgot to update my Android build scripts to deal with some subdirectories I made for Music and Sounds, so once I addressed it, I had sound effects.

But I still had no music. Weird.

My initial investigations told me that my code definitely thinks that the music is playing. It wasn’t a volume issue.

But eventually I looked at the logs and found a line that said that there was, in fact, a problem loading the music file. “Unrecognized audio format” was not the error I was expecting, though.

Most of my sound effects are .wav files, and my music file is also a .wav file. What gives?

Well, it turned out that libSDL2_mixer has a configuration flag that you can use to specify that you want to support .wav music files. My custom-built version does not have it. Oddly, .wav sound effects are supported just fine out of the box.

Do I want it? No, the point of limiting support to .ogg files primarily is that I want as slim a library bundled with my app as possible.

And speaking of slimming things down, that .wav music file? It was 9+ MB! THAT’S HUGE!

So I created a .ogg file instead, which doesn’t even take up 1MB, and music works in my Android build just fine.

I also made sure to use the latest libSDL2 and related libraries, which required a few minor updates in code.

Clown Alley Creator - Android build

At this point, I want to test things out on my end before releasing it to testers, but I expect to have a build ready for them this week. I’m looking forward to the feedback.

Thanks for reading, and stay curious!

Want to learn about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!

One reply on “Freshly Squeezed Progress Report: Android Audio Woes”

Leave a Reply

Your email address will not be published. Required fields are marked *