Skip to content
UniKit

Extract audio track

Decode the first audio track of a video / audio container in the browser, cut it, normalise the sample rate and channels, and export 16-bit WAV — with an honest error when the container cannot be decoded.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Pick a video or audio file: MP4 / WebM / MOV / M4A / MP3 / OGG / FLAC tracks are decoded by the browser, WAV is parsed here; nothing is uploaded.

Pick an audio file first (or press Record).

Result

Duration, sample rate, peak and size below are the real numbers from this run.

Pick a file and the preview plus download show up here.

Containers the browser cannot open (MKV / AVI / WMV / RMVB)

These containers have no built-in browser decoder and this tool does not pretend otherwise: the page reports that the browser cannot decode the file and the result stays empty. The command below is a reference for **ffmpeg on your own machine**.

ffmpeg -i input.mkv -vn -map 0:a:0 -c:a aac -b:a 192k -ar 44100 output.m4a

That is a command, not a result of this tool: nothing is transcoded in the browser for MKV. Containers the browser can open (MP4 / WebM / MOV / M4A / MP3 / OGG / FLAC) are really exported to WAV above.

What this tool does

  • Pull the audio track out of an MP4 / WebM / MOV and keep it as WAV: no ffmpeg install, the browser decodes it and you can listen before exporting
  • Grab just the system sound from a screen recording for subtitles: take 0:30 to 0:45 and drop the rate to 16000 Hz for speech recognition
  • Normalise a batch of material: bring 48 kHz stereo down to 16 kHz mono before the next step

Example

Input

tone.wav (8000 Hz mono, 2 s, peak 0.5) → start 0.5 / clip length 1 s / output rate 16000 / mono / volume 0 dB

Output

tone-track.wav: source track 0:02.000, cut 0:00.500 → 0:01.500, export 0:01.000 (16000 Hz mono), 16000 samples; 500 ms discarded at either end; peak -6.02 -> -6.02 dBFS; WAV 32044 B

Every number comes from this run: the track really was decoded and the WAV is encoded in your browser, ready to play and download.

Frequently asked questions

Does it really extract the audio, or just print a command?

It really extracts it. After you pick a file the browser decodes the track of MP4 / WebM / MOV / M4A / MP3 / OGG / FLAC with AudioContext.decodeAudioData (WAV is parsed by this site), then the track is cut, resampled and down/up-mixed according to your options and encoded to 16-bit WAV for playback and download. Duration, sample rate, channel count, peak and size are the real numbers of that run.

Why is the export always WAV and never MP3?

Browsers ship MP3 / AAC decoders but no encoder (LAME is LGPL and this site adds no third-party dependencies). The export is therefore always 16-bit PCM WAV: bigger than MP3 but lossless. Convert it elsewhere if you need MP3.

Does it work with MKV / AVI / WMV?

No. Those containers have no built-in browser decoder, so the tool reports that the browser cannot decode the file and leaves the result empty instead of pretending. The ffmpeg command further down the page is a reference for ffmpeg on your own machine; this tool neither runs it nor produces its output.

How is this different from extract-by-time and video-to-audio?

This tool cuts with a start plus a length, which suits “take 15 seconds from 0:30”. Use extract-by-time when you want to set both edges explicitly and see how much of each end is discarded; use video-to-audio when you want the whole track with only output specs changed. All three decode and export WAV the same way — only the time parameters and the result lines differ.

How does the sample-rate conversion work?

It uses the linear-interpolation resampler in @/lib/audio-core: output length = input length × target rate ÷ source rate. It is deterministic and fast but has no anti-aliasing filter, so downsampling folds high frequencies (48000 → 16000, for example). For quality-critical downsampling keep the source rate or process the WAV with a dedicated tool.

Keywords:wavextract audio

Related tools