.ogg

Term side of the Card.
Topic: Audio
Unit title: .ogg
Categories: Format
Explanation side of the Card

Explanation: The open-source container format, commonly used with the Vorbis audio codec. It provides high-quality audio compression and is used in streaming services and video games.

Example

Wronghtml
<audio controls>
  <source src="theme.ogg">
</audio>
Righthtml
<audio controls>
  <source src="theme.ogg" type="audio/ogg; codecs=vorbis">
  <source src="theme.mp3" type="audio/mpeg">
</audio>

With a type the browser skips sources it cannot play without downloading them, and the MP3 covers the rest.

Common mistakes

  • Treating Ogg as a codec, while it is a container that can hold Vorbis, Opus or other streams.
  • Shipping only .ogg audio, so some browsers play nothing.

Key points

  • The <source> type names the codec inside, such as 'audio/ogg; codecs=opus' or 'audio/ogg; codecs=vorbis'.
  • An .ogg source is followed by an .mp3 or .m4a fallback for browsers that cannot play it.

Interview questions

Is OGG the same as Vorbis?

No. Ogg is a container and Vorbis is an audio codec often stored in it. An .ogg file can also hold Opus or other codecs.

OGG vs MP3: which is better?

Ogg Vorbis often sounds better than MP3 at the same bit rate and is royalty free. MP3 plays on more devices.

Why do games use OGG audio?

Ogg Vorbis is free of licensing fees, compresses well and loops cleanly, which suits game music and effects.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy