Back to MIME Types

audio/webm WebM Audio Common

Identifies audio-only WebM files, typically containing Opus or Vorbis-encoded audio in the same container used for WebM video.

What it's for

audio/webm identifies audio-only content in a WebM container — the same open, royalty-free container format used for WebM video, but holding just an audio track (typically Opus, sometimes Vorbis) with no video stream. It shares WebM's open-source, patent-unencumbered design goals and is commonly encountered specifically in browser-based audio recording APIs, where it's often the default or most straightforward output format for audio captured directly in the browser.

Format & syntax

Content-Type: audio/webm

No parameters. As with other container-vs-codec distinctions, the actual audio codec inside (most commonly Opus) determines quality and compatibility characteristics more than the WebM container designation alone.

How it's used in practice

  • Browser-based audio recording (MediaRecorder API) — the JavaScript MediaRecorder API, used for capturing audio directly in the browser (voice memo features, in-browser recording tools), commonly defaults to producing WebM/Opus output on many browsers, making this a very common practical touchpoint for web developers building recording features.
  • WebRTC-adjacent audio capture and processing — browser-based real-time communication and audio-processing applications frequently encounter WebM-contained Opus audio as part of the underlying browser media capture pipeline.
  • Open-source-focused audio distribution — similar to Ogg, WebM's open licensing makes it a natural fit for platforms and projects prioritizing open formats over patent-encumbered alternatives.
  • Voice note and messaging features — in-app voice message recording features built on web technology often produce and store WebM audio directly from browser recording APIs, sometimes converting to another format server-side afterward depending on playback compatibility needs.

Common mistakes & gotchas

  • Assuming browser-recorded WebM audio plays back identically everywhere — while modern browsers that can record WebM/Opus audio can generally also play it back, if you need to support playback in contexts outside modern browsers (certain mobile apps, older systems, specific third-party integrations), converting to a more universally compatible format server-side is often necessary.
  • Not handling the codec variability within WebM audio recordings — different browsers and MediaRecorder implementations may produce slightly different codec configurations within the WebM container, which can occasionally cause subtle compatibility differences when processing recordings across a range of browsers.
  • Confusing audio/webm with video/webm — they share the same underlying container technology but represent fundamentally different content (audio-only vs. video-with-audio); code handling one shouldn't assume it correctly handles the other without adjustment.
  • Server-side processing not expecting browser-recorded WebM format — backend audio processing pipelines built primarily around more traditional formats (WAV, MP3) sometimes need explicit handling or conversion logic added specifically to correctly ingest WebM/Opus recordings coming directly from browser capture APIs.

Comparison & FAQ

Type Purpose Key difference from audio/webm
video/webm The video counterpart in the same container family Contains a video stream (plus audio); audio/webm is audio-only
audio/ogg Similar open-format audio container A different but related open container, often overlapping in the codecs it commonly holds (like Opus)

Why does my browser's audio recording feature produce a WebM file?

Many browsers' MediaRecorder API defaults to WebM (typically with Opus audio) as its output format for browser-captured audio — this is standard, expected behavior for browser-based recording rather than something you need to configure explicitly in most cases.

Do I need to convert browser-recorded WebM audio before storing or playing it elsewhere?

If your playback or processing context is limited to modern browsers, often not. If you need broader compatibility (certain mobile apps, older systems, specific third-party services), converting to a more universally supported format server-side is a common and often necessary step.

Is audio/webm the same as video/webm?

No — they share the underlying WebM container technology, but audio/webm contains only an audio stream while video/webm contains video (typically with an accompanying audio track); handling code for one doesn't automatically handle the other correctly.

What audio codec does WebM typically use?

Most commonly Opus today, occasionally Vorbis — both are open, royalty-free codecs, with Opus generally being the more modern and technically preferred choice for most current use cases.