Jump to content

Opus codec for 0 A.D. sound files


Salesome
 Share

Recommended Posts

I did some research and found out that the Opus (Wikipedia) codec might be worth a try for the game's sound files.

Currently, all 0 A.D. music files are encoded with 160 kbit/s using OGG Vorbis. With Opus, it would be possible to encode them with 96 kbit/s, where the threshold for transparency is for this format (Source). Maybe they could even be encoded with 64 kbit/s (At least, I don't hear the difference). Several ambient sounds might be encoded with even lower bit rates (for speech, 32 kbit/s is sufficient using Opus (see link above)).

The sound files currently make up about 150 MB of the installer. The savings could amount to about 50-60 % by encoding with Opus at a lower bitrate, which would result in a ~75 MB smaller download. Doing a quick re-encode of all music files with 96 kbit/s VBR, I obtained 51 MB (as opposed to originally 109 MB).

One big advantage of the Opus format, apart from the better encoding quality, is a very low latency (~25 ms). It can also be packed into OGG containers (so the configuration files don't need to be re-written). A possible downside is that decoding Opus files takes more CPU power than OGG Vorbis (I am not a programmer though, so I cannot quantify that).

I attached a few 0 A.D. music files in Opus format as samples (encoded from the .wav files in trac).

Ammon-Ra_96_kbits.opus

Honor_Bound_2014_96kbits.opus

Ammon-Ra 64 kbits.opus

Honor_Bound_2014 64 kbits.opus

Edit: VLC Player can open the files.

Edited by Salesome
  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...