Opened 12 years ago

Closed 12 years ago

#1667 closed enhancement (wontfix)

add support for opus audio codec

Reported by: fabio Owned by:
Priority: Should Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

Opus audio codec was recently standardized as an IETF standard: https://hacks.mozilla.org/2012/09/its-opus-it-rocks-and-now-its-an-audio-codec-standard/

It would be nice to add support for it to 0 A.D., it would provide the following enhancements:

  • audio file size reduction with a similar quality (it's better than currently used vorbis);
  • eventual support for in-game chat with the same codec (vorbis was not designed for real time use);
  • more awarness for 0 A.D. due to the use of a leading audio codec.

More information can be found at: http://opus-codec.org/

Then ogg files should be converted from their lossless source to opus and vorbis support eventually removed to leave only one codec.

Change History (5)

comment:1 by Deiz, 12 years ago

There's not much point to re-encoding the existing audio. All of the existing music is Vorbis -q5 (160 kbps VBR), which is well past where Opus and Vorbis quality converge (Opus's comparison chart stops at 128 kbps). There's also one major drawback: Opus is a very new, poorly-supported format. Re-encoding the music would make it unplayable in most audio players, a problem that will likely persist for several years.

In-game VoIP is a valid concern but I think that's a bridge to cross when we come to it.

comment:2 by historic_bruno, 12 years ago

I agree with Deiz, this isn't really something we want to pursue is it? There are much bigger concerns in the audio engine without worrying about switching codecs.

foobar2000 (my media player of choice) just recently got Opus support and I imagine it's well ahead of the curve there.

in reply to:  1 comment:3 by fabio, 12 years ago

Replying to Deiz:

There's not much point to re-encoding the existing audio. All of the existing music is Vorbis -q5 (160 kbps VBR), which is well past where Opus and Vorbis quality converge (Opus's comparison chart stops at 128 kbps).

This is another problem already reported here: http://www.wildfiregames.com/forum/index.php?showtopic=13859 . There is probably no need to use rate over 64kb/s for in game music and just that it would save a lot MB. (Opus comparison chart stop at 128 kbps because at that bitrate all formats are almost transparent - can't hear the difference against the original)

There's also one major drawback: Opus is a very new, poorly-supported format. Re-encoding the music would make it unplayable in most audio players, a problem that will likely persist for several years.

It was standardized with the 1.0.0 release just three days ago indeed, but it's already quite well supported in the software, others will follow soon (it's also required by webrtc standard).

But I suppose you mean hardware players (iPod &c)? Vorbis is still not universally supported, also I suppose users won't extract opus files from public.zip to hear them. Audio files for use on hardware players can still be distributed on the 0 A.D. web page coded with FLAC/MP3/Vorbis.

comment:4 by Deiz, 12 years ago

The music presently constitutes 75 MB, whereas the xz-compressed alpha 11 archive is 350 MB. If the music were 64 kbps, the total figure might drop to 310 MB, or so. I don't consider that to be a big gain, especially because the data archive tends to grow by around that amount with every release.

Besides, although Opus is designed to perform better at low bit rates, their own (subjective) charts still do show the 'diminishing returns' convergence at 128 kbps, which is to say that 64 kbps Opus would yield a reduction in sound quality. I don't think there's any need to make that compromise, because we're not bumping into a hard limit on the size of the data archive. If 350 MB is a problem for users, then ~300 MB likely is, as well.

comment:5 by historic_bruno, 12 years ago

Milestone: Backlog
Resolution: wontfix
Status: newclosed

Sounds like it's worth revisiting if we want to implement our own in-game voice chat, but I haven't heard that we plan that feature and there are a lot of free VOIP solutions out there anyway. I would rather discuss this on the forum until then.

Note: See TracTickets for help on using tickets.