Audio Extractor
Extract audio from video files (MP4, WebM, MOV) directly in your browser. Export as WAV or WebM with optional trimming and waveform preview.
About
Extracting audio from video files typically requires desktop software or server-side processing. This tool performs the entire operation client-side using the Web Audio API and MediaRecorder API. Your files never leave the browser. It decodes the media container, isolates the audio track as raw PCM (Float32 samples), and re-encodes it into a downloadable format. The waveform visualization renders amplitude peaks calculated from the decoded AudioBuffer, giving you precise visual feedback for trimming. Note: decoding support depends on your browser's built-in codec library. Chromium-based browsers handle MP4 (AAC/H.264), WebM (Opus/Vorbis), and OGG reliably. Safari may reject WebM containers.
If you need a specific segment, the trim controls map your time selection to sample indices at the file's native sample rate (fs), typically 44100 or 48000 Hz. WAV output is uncompressed PCM - lossless but large. WebM/OGG output uses the browser's Opus encoder at approximately 128 kbps. For files exceeding 200 MB, expect processing delays proportional to duration. Pro tip: if extraction fails, try converting the source to WebM first - it has the broadest decoding support across modern browsers.
Formulas
WAV files use the RIFF container with a WAVE format chunk. The tool constructs the binary header manually before appending interleaved PCM sample data.
Where fs = sample rate in Hz, C = number of channels, B = bytes per sample (typically 2 for 16-bit PCM), T = duration in seconds, and 44 = RIFF header size in bytes.
Trimming maps time boundaries to sample offsets:
Where tstart and tend are the trim boundaries in seconds. The tool slices each channel's Float32Array between these indices. For waveform rendering, the buffer is partitioned into N buckets (one per pixel column), and each bucket's peak amplitude is computed as:
16-bit PCM conversion clamps floating-point samples from [−1, 1] to signed 16-bit integers [−32768, 32767]:
Reference Data
| Container Format | Common Audio Codecs | Chrome Support | Firefox Support | Safari Support | Typical Bitrate | Max Channels |
|---|---|---|---|---|---|---|
| MP4 (.mp4, .m4v) | AAC, MP3, AC-3 | ✅ Full | ✅ Full | ✅ Full | 128 - 320 kbps | 8 |
| WebM (.webm) | Opus, Vorbis | ✅ Full | ✅ Full | ⚠️ Partial | 64 - 510 kbps | 8 |
| OGG (.ogg, .ogv) | Vorbis, Opus, FLAC | ✅ Full | ✅ Full | ❌ None | 80 - 500 kbps | 8 |
| MOV (.mov) | AAC, ALAC, PCM | ✅ Full | ⚠️ Partial | ✅ Full | 128 - 1411 kbps | 6 |
| MKV (.mkv) | AAC, Vorbis, FLAC, AC-3 | ⚠️ Partial | ⚠️ Partial | ❌ None | 128 - 1411 kbps | 8 |
| AVI (.avi) | MP3, PCM, AC-3 | ❌ None | ❌ None | ❌ None | 128 - 320 kbps | 6 |
| WAV (.wav) | PCM (uncompressed) | ✅ Full | ✅ Full | ✅ Full | 1411 kbps (16-bit stereo) | 2 |
| FLAC (.flac) | FLAC (lossless) | ✅ Full | ✅ Full | ✅ (14.1+) | 400 - 1200 kbps | 8 |
| MP3 (.mp3) | MP3 | ✅ Full | ✅ Full | ✅ Full | 64 - 320 kbps | 2 |
| AAC (.aac, .m4a) | AAC-LC, HE-AAC | ✅ Full | ✅ Full | ✅ Full | 64 - 320 kbps | 6 |
| 3GP (.3gp) | AMR, AAC | ⚠️ Partial | ⚠️ Partial | ⚠️ Partial | 8 - 128 kbps | 2 |
| WMA (.wma) | WMA, WMA Pro | ❌ None | ❌ None | ❌ None | 64 - 384 kbps | 6 |