audio/ogg audio/ogg means: audio/ogg is the registered media type for audio in an Ogg container, usually carrying the Vorbis or Opus codec. Ogg is an open, patent-free format; Opus in particular delivers excellent quality at low bitrates and is favored for real-time communication. Audio media types describe sound containers and codecs. The subtype tells the player which demuxer and decoder to load, and browsers use it in Accept headers and canPlayType() checks to negotiate a format they actually support. Choosing a widely supported audio type avoids silent playback failures on devices that lack a proprietary codec. You will encounter audio/ogg in contexts such as open-format audio distribution; webrtc and real-time voice using opus; game and application audio assets. It is commonly associated with the file extension(s) .ogg, .oga. Specify the codec when it matters: audio/ogg; codecs=opus versus codecs=vorbis. Safari historically lacked Ogg/Vorbis support, so provide an MP3 or AAC fallback for broad playback. The .ogg extension may also hold video (video/ogg).
When you'll see audio/ogg
- Open-format audio distribution
- WebRTC and real-time voice using Opus
- Game and application audio assets
How to handle it
When delivering audio, declare the precise container type, support byte-range requests so players can seek, and offer at least one broadly supported fallback. Test playback with canPlayType() across target browsers rather than assuming a codec is present. For streaming, set the correct type on each segment and keep timestamps consistent so the player can buffer and seek without glitches. As a final checklist for audio types: support byte-range requests for seeking, offer a universally supported fallback, normalize loudness for consistent playback, test canPlayType across target browsers, and keep segment timestamps aligned when streaming so buffers do not stall.
Notes & gotchas
Specify the codec when it matters: audio/ogg; codecs=opus versus codecs=vorbis. Safari historically lacked Ogg/Vorbis support, so provide an MP3 or AAC fallback for broad playback. The .ogg extension may also hold video (video/ogg).
Examples
HTTP/1.1 200 OK
Content-Type: audio/ogg
Accept-Ranges: bytes
Content-Disposition: inline; filename="sample.ogg"
[binary audio payload: the encoded bytes of a sample .ogg] curl -i -H "Accept: audio/ogg" https://api.example.com/v1/resource # inspect the returned Content-Type const res = await fetch("/media/sample.ogg", { headers: { Accept: "audio/ogg" } });
const blob = await res.blob(); // blob.type should be "audio/ogg"
const url = URL.createObjectURL(blob); // assign to img.src / audio.src / video.src
// revoke with URL.revokeObjectURL(url) when done to free memory import requests
res = requests.get("https://api.example.com/v1/resource",
headers={"Accept": "audio/ogg"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("audio/ogg")
with open("sample.ogg", "wb") as fh:
fh.write(res.content) # raw bytes; use stream=True for large files Frequently asked questions
What is the difference between Ogg Vorbis and Opus?
Both can live in an Ogg container; Vorbis is older and tuned for music, Opus is newer, lower-latency and better across speech and music. Declare the codec parameter to disambiguate.
Does Safari play audio/ogg?
Support has been limited historically, especially for Vorbis. Provide an MP3/AAC fallback source so Safari users still get playback.
Why does my audio file fail to play in some browsers?
Codec support varies. Check HTMLMediaElement.canPlayType() with the exact MIME type, and provide a fallback source. A container the browser recognizes but a codec it lacks will still fail silently.
Are audio MIME types the same as file extensions?
They map closely but are not identical: .mp3 maps to audio/mpeg, .m4a to audio/mp4, .ogg to audio/ogg. The container and codec both matter, so trust the declared type over the extension when they conflict.
How do I let users seek within an audio file?
Serve it with Accept-Ranges: bytes and support HTTP range requests so the player can fetch arbitrary offsets. Without range support the player must download the whole file before seeking works.
Try the Base64 Encoder
Encode and decode Base64 with UTF-8 and URL-safe options.