A Seamless Theme Tune
If you’ve tried out the game you’ll have heard our theme tune but may have noticed it had a couple of problems. I’m happy to say those problems have been fixed today!
The tune was composed in Strudel as described in an earlier post: Theme Tune. At the time the only way to export a tune from Strudel was to record the audio directly from the browser. This was not a exact method: it was impossible to avoid small jumps and skips in the result and many other Strudel users were interested in this getting fixed. As a result our own theme tune had a small skip in it near the start.
In the latest Strudle however you can now export directly to a sound file (WAV) and get a perfect rendition of your tune. We are grateful to the Strudel team for adding this feature and happy to now be able to play the perfect version in our game.
There was a second issue though too: the tune is designed loop endlessly without any gap. For this to work the game’s audio engine need to jump perfectly from the end to the beginning without interruption. When the tune was included in the game it was encoded in the MP3 format. Unfortunately MP3 is famous for being incompatible with seamless playback, it often adds silence at the end to pad the audio data into a neat number of frames. The Ogg format does not suffer from this issue and it was a simple matter to re-encode our tune in this format.
As a bonus Ogg has better compression, saving space and memory. It is also free and open, unrestricted by software patents (see Ogg). These are values we are very keen on, being free and open ourself!
This solved the problem of seamless playback on Desktop but on Android devices it still had a small audible gap. To solve that we needed to adopt a more sophisticated audio engine called gdx-miniaudio which has much better performance on mobile devices.
We are grateful for help from the LibGDX community in working through this problem. We hope to contribute back by adding this information to their wiki so other games can benefit too. We’ll link to it here if that gets accepted by them.
So if you’ve not had a try of the game yet now’s a great time as it’s sounding better than ever!