“Audio Metadata in Ogg, MP3, and others”

Written on:December 6, 2013
Add One

A picture of a bright colored fish (ID3 Picture Type #17) and perhaps something more(Now that it’s come out in the official Hacker Public Radio feed, here’s the even-more-awesome opus version. If you want the Ogg Vorbis, Speex, or crappy-old-mp3 versions, check out the official Hacker Public Radio page instead)

“Today’s episode discusses (and encourages) the use of metadata tags in audio files. Most of the episode is spent on id3v2.3 metadata for mp3 files) and vorbiscomments (metadata for opus, ogg vorbis, flac, and speex files), and how to mix them, though metadata in webm/matroska, windows media, and wav files is briefly discussed as well.

This episode’s files have also been crafted with substantially more metadata than the ID3v1 set of tags that HPR normally limits itself to, to serve as examples.

Listeners to the opus, ogg (vorbis), or speex versions will also have access to chapter markings if your playback software recognizes standard vorbiscomment chapter metadata. (No chapter markings in the mp3, as support for it is extremely sparse, and I’ve not yet even managed to find a tool for making mp3 chapters that actually works – the java utility I mention in the episode crashes on me without starting…)

All metadata conforms to the published standards, so your playback software should at best fully use it all, or at worst simply ignore it. If your player software actually DOES have a real problem with this file, I would very much like to know!

If there’s anything wrong with the metadata, blame Epicanis, not HPR (I did the metadata myself).

If you hear or see any errors in this episode, please tell me. I’ll issue appropriate corrections in subsequent episodes. If I’m a big enough screwup with this episode, I could even do a small episode on “everything I got wrong in my metadata episode” if I did badly enough. I don’t THINK there should be more than a few minor errors or omissions here, though.

ERRATA: In chapter 18 (at 34:53) there is one small error: oggenc does NOT transfer attached pictures from flac input (though it DOES transfer all vorbiscomment metadata. FLAC stores attached pictures in a separate metadata structure so oggenc misses it. opusenc – at least in recent beta versions – DOES appear to transfer the attached pictures as well as the vorbiscomments, though. Another reason to upgrade to opus, I suppose…)”

If you right-click and “save as” on this link right here you can directly download the .opus file to examine and play back outside of this web page as well.

If you see the audio playback controls there but nothing plays, make sure you’re running a current enough browser that supports the Opus audio codec. Firefox supports it since FF15. Chrome has support but Google hasn’t gotten around to turning it on by default (you can enable it yourself in the advanced setting by turning on the “Enable opus in video[sic]” option.). Apple and Microsoft are still dragging their feet as of the end of 2013 and their support for web audio is quite limited.

You can test your browser’s support for HTML5 audio on The little test page I set up for that purpose. If the “opus” selection doesn’t work there, the audio won’t work on this page either.

12 Comments add one

  1. Laurence says:

    Very useful test page, I’d not heard of Opus before. I will add that Firefox definitely does support MP3, even though the test failed it; this is because it is VERY difficult to get FF to use anything other than its internal player, so I have disabled it and transfer playback to Winamp. Don’t know about Flac, but I suspect it may not be supported.


    • Epicanis says:

      Mozilla (as I understand it) has made a special exception for “mp3” and “m4a” (and, I think, “aac”) files if the “system” libraries support them, but I haven’t bothered trying them. When I finally do, I’d be curious to see if they also enabled FLAC the same way.

      I also need to add “.m4a” files with ALAC audio in them to the test – unless there are some idiotic patents lurking in the MP4 file format itself, ALAC would represent at least ONE legally-free codec that the Appleites can handle (even if it’s a huge, lossy, bloated format by “internet audio” standards).

      For my part, these days I stick to just FLAC (for archiving) and .opus for audio. I don’t even use .ogg (vorbis) any more except occasionally as a “legacy support” thing.

  2. steve says:

    hey thanks for that test page, I don’t know if you know a simple script that can create html5 pages of music folders? I was able to get everything to play back… thanks bro

  3. QJ says:

    A little off-topic here, but does anyone know if the decodeAudioData function from Web Audio API works in both Firefox and Chrome for OPUS packets? I tried to send those packets to my website using websocket, then I decode these packets using decodeAudioData function. This works in Firefox, but not in Chrome. The fact is, even a perfect normal OPUS file won’t get decoded in Chrome while FF just do the job well. The file does get played in chrome if I just drag it into the browser. So I was wondering what I might be doing wrong or maybe Chrome just haven’t implemented it yet. I have sample code for anyone interested to test it.

    • Epicanis says:

      Hypothetically, current versions of Chrom(ium|e) should handle .opus files, but Google dragged their feet for something like an extra year and a half after Firefox support went live, so I wouldn’t be surprised if they weren’t paying attention to it when they implemented decodeaudiodata(). I’m not entirely certain, but the documentation I’ve seen so far makes it look like any type of audio that chrom(ium|e) can decode SHOULD be usable with the web audio API – if not, it’s another bug (I think).

      Especially if .opus files don’t even work in <audio> tags for you (not sure from your question whether that’s the case or not), though, check Chrome’s configuration flags for “enable opus decoding in <video>” and make sure if it’s there that it’s enabled (it’s been in previous versions of chrome/chromium for a while now, but defaulted to disabled. Supposedly it defaults to enabled now, but I’m not sure.)

      • QJ says:

        Hi Epicanis,

        Yes, tag does work in chrome for OPUS files. What doesn’t work is the decodeAudioData function from the Web Audio API.
        I’ve borrowed the code from to test with .opus files. I’ve modified the code a bit to support Firefox too. Then, simply put, the same code works in Firefox but not in Chrome for opus files. Other files like mp3, Vorbis do work in both browsers with the same code.
        I also have a strong suspicion that this is just not possible with Chrome yet. Maybe it’s a bug, which I hope it is. Then I’ll try to contact Chrome team to raise the question.
        But I hope even more that it’s something I did wrong that caused it. Anyway I do have another option here which is Vorbis. All that hype around opus feel like an ice cold shower atm.

        • QJ says:

          I forgot to mention. The setting for disable opus in *video>* tag in Chrome isn’t enabled. And I can play opus files in chrome by directly drag the file into the browser or by using the *audio>* tag.

  4. J7N says:

    The APEv2 metadata standard deserves a mention, since it allows for the same flexibility as Vorbis comment, and can be used with any audio format that doesn’t break when extra data is appended at the end of the file. Despite being unavailable during streaming, tags at the end do have the practical advantage that they can be written and updated fast. As a standard, APEv2 is used for open formats such as, Monkey’s Audio (ape), WavPack, MusePack, and TAK.

    APEv2 unfortunately hasn’t become popular with MP3 files. I am using it myself because ID3v2 sucks (say that three times), and decent Windows software, including open players using the MediaInfo component, Foobar2000, Winamp and several tag editors, read and even write it.

    Almost all fields from Vorbis Comment can be copied over to any file as an APEv2 tag, and then copied back to a FLAC or Opus file, and multi-value fields (separated by nulls in APEv2) and Unicode special symbols (stored UTF-8) will be retained. Tag editors should take care of translating the standard field names, such as “DATE” in Vorbis, and “Year” in APEv2, which does in fact store an ISO date of any precision.

    Audio files in formats like MP3, ADTS AAC, AC-3, and DTS (multichannel music), can all have full metadata that follows the one good standard, without a need for re-encoding of the audio.

    A good music-centric standard or Vorbis Comment field names comes with MusicBrainz Picard.

    It defines important fields for use in a music collection, like, Media (cd, vinyl), Label (Organization), CatalogNumber, ReleaseTyle (album, single). The standard is incomplete, but is a good starting point.

    MP4 and WMA are awful proprietary formats, which I find unusuable mainly because their metadata are poorly supported.

    I enjoyed your show.

    • Epicanis says:

      I’m just realizing that I really should have replied to this months ago…

      I wasn’t sure if I should mention APE in this episode, but I will be mentioning it in an upcoming followup episode Real Soon Now (I’m working on a series of 3 episodes at once – I really need to be producing more than 1 HPR episode per year…)


  5. Leandro says:

    Hi! Your test page has been really useful. I made sure my Chrome Extension, Extereo Audio Player, supports all the formats you described, specially the glorious and almighty Opus! I added a link to your test page in the announcement of release v3.3.0, both in the Facebook and Google+ pages of the project.

Leave a Comment

Bad Behavior has blocked 47 access attempts in the last 7 days.