Extract Audio from Video
Operator: Abdulla Al Fahad. How tools are built and checked
A video's soundtrack is a separate stream inside the file, and most of the time a browser can read it without playing the picture at all. This page does that: it reads the file's bytes, decodes the audio track with the browser's own decoder, trims it if you ask, and saves it as WAV. If the browser cannot decode the track directly but can play the video, the page plays the video once in real time and records its sound through a media stream instead. That compressed recording is WebM with Opus where the browser's recorder writes it (Chrome, Edge and Firefox), and M4A with AAC in Safari, which offers only that format.
Before any work starts the page looks at the file's header for an audio track. A clip with no sound is reported as having no audio, rather than producing an empty file. Everything runs in the tab, and the video is not uploaded.
Key features
- Soundtrack decoded straight from the file, with a waveform and draggable start and end handles
- Real-time fallback for files the decoder rejects, with its own progress bar and a Cancel button
- Clear message when the video has no audio track, checked before any decoding
- WAV at the track's own sample rate, and WebM with Opus recorded at 128 kbps
- Optional mono mix and peak normalising, applied to the WAV
- Size estimate shown before saving, both for the exact WAV size and the approximate WebM size
When a soundtrack decodes and when it fails
Accepted files are MP4, WebM, MOV, M4V and MKV. MP4 files with H.264 video and AAC audio, and WebM files with VP8 or VP9 video and Opus audio, work in all the major browsers. MOV and MKV open only when the browser has the codecs inside them, and when the soundtrack will not decode but the picture plays, the page uses the real-time route.
Files up to 1.5 GiB are read into memory and decoded in one pass. Larger files skip decoding and go straight to the real-time route, which records the soundtrack while the video plays. A decoded soundtrack is also capped at 60 minutes of stereo at 48 kHz; a longer video takes the real-time route for the same reason.
Start and end are seconds, typed as 12.5 or 1:05.5, and the selection is checked against the length the browser reports. The result is the trimmed soundtrack only, with no picture, subtitles or chapter markers. Leaving the full range keeps the whole track.
The WAV has the decoded track's sample rate and channel count, 16-bit PCM, and a 44-byte header. Mono mixes the channels into one by averaging, and normalise scales the whole result so its peak is -1 dBFS. The compressed file is recorded at 128 kbps, and its size is estimated before you save as the bit rate times the length, plus about 2 per cent for the container.
How it works
The page sniffs the first bytes of the file. For MP4 and MOV it reads the moov box and the first sound track's handler, sample description and sample rate; for WebM and Matroska it reads the Tracks element and the Audio sub-element's SamplingFrequency; Opus tracks are always 48 kHz. A file with a sound track it can see is decoded with decodeAudioData at the rate it reports, so the samples are not resampled.
When decoding fails or the file is too large, the page creates a hidden video element with the file's object URL, routes its sound through a Web Audio media element source into a MediaStream destination, and records that stream with MediaRecorder. The video is seeked to the start, played until the end time, and the recorder is stopped. Recording takes as long as the selected span.
A quiet recording is not the same as no audio. About a second and a half into real-time playback the route asks the browser whether the element has an audio track, using its audio-track list or, where that is all the browser exposes, its decoded-byte count. Only a clear answer of no audio stops the recording with the no-audio message; anything else keeps recording.
Common use cases
- Pulling the narration out of a product walkthrough to send to a transcription service
- Keeping only the music from a clip recorded on a phone, so it can be shared as a sound file
- Saving a lecture's audio for a podcast feed without re-encoding the video
- Checking whether a screen recording actually picked up the microphone, by saving its soundtrack and listening to it
How to use this tool
- Choose or drop a video. The page reads its header and reports the duration once it knows it.
- If the soundtrack decodes, the waveform appears. Set the start and end by dragging the handles or typing, and use Play selection to check the span.
- Choose mono or normalise if you need them. The Output panel shows the WAV size and the WebM size estimate.
- Click Save WAV for an immediate file. Click the real-time button, which names the format the browser's recorder writes (WebM with Opus, or M4A with AAC in Safari), and Cancel if you change your mind.
- Play each result in the panel and download it.
Example
A 3-minute screen recording with AAC audio at 48 kHz stereo, trimmed from 0:20 to 1:45 and saved as WAV
File screen-demo.mp4 (3:00.00, 48000 Hz, stereo, AAC)
Selection 20.00 s to 105.00 s (85.00 s)
Mono off
Normalise offOutput sizes
WAV 85.00 s, 48000 Hz, 2 channels, 16-bit
16,320,044 bytes (about 15.6 MB)
WebM (Opus) 1,387,200 bytes at 128 kbps (shown as 1.32 MB), recorded in 85 s
With mono on WAV is 8,160,044 bytesTips for best results
- Check the sample rate line under the file details. A 44.1 kHz soundtrack gives a 44.1 kHz WAV, and most video-editing tools expect 48 kHz, so resample afterwards if the next tool needs it.
- Use the trim fields on a video whose sound starts late. Phone recordings often have a half-second of silence before the first word, which the handles can skip.
- Mono is the better choice for speech, since it halves the WAV size and speech rarely needs separate left and right channels.
- For a long video, expect the real-time button to take as long as the selection. A 30-minute lecture needs 30 minutes with the tab in the foreground.
Edge cases to watch
A video with no sound track is reported as such before any work starts. If a video plays without sound in the browser, the file may have been exported silent, or its audio codec may be missing from the browser; the page cannot restore audio that the browser does not decode.
MP3 is not offered. Browsers include no MP3 encoder, so this page saves WAV or WebM with Opus only.
The real-time route stops on the first check after the end time, and those checks run every 100 ms, so a recording can run up to about 0.1 s long. In testing, a 1-second selection recorded this way decoded to 0.96 s in every run, so check the length of the result when it matters.
What the extractor cannot do
It cannot pull audio from a file that the browser cannot open at all. Some files play with picture but no sound when the browser lacks their audio codec, and the page can only report that, not fix it.
It does not separate speech from music, remove background noise or sync audio to a different video. It saves the track it finds, with the trim and level changes you choose and nothing else.
It does not keep several tracks. A video with two languages or a commentary track gives you the one the browser decodes, which is normally the default track.
The real-time route runs at the speed of the video: recording a two-hour film takes two hours, because the sound can only be captured as it plays.
Memory and the 1.5 GiB read limit
The page reads the whole video into this tab, picture included, because the browser needs the container to find the sound track. The picture is never shown or saved. The bytes stay in the tab's memory and nothing uploads them, so the sound from a meeting recording or a family video is extracted on the device that holds it.
A large video can be heavy on a laptop with little memory. The 1.5 GiB read limit exists for that reason, and files past it use the real-time route, which holds only the encoded recorder chunks for the length you ask for, not decoded samples.
Frequently asked questions
Why does it say the video has no audio when it plays with sound?
The header check looks for a sound track in the file, and that is the first thing the page tests. The no-audio message appears when the header lists no sound track, when decoding returns zero samples, or when the real-time route finds the element has no audio. A video whose sound is present but in a codec the browser cannot decode gets the real-time route rather than that message.
Why are the WAV and WebM files different lengths?
The WAV holds exactly the samples between your start and end times. The compressed file is recorded from playback, so the browser can add or drop a few milliseconds at each end and the container adds a little overhead. For a precise length use the WAV.
Can I get the sound from a video I only have as a link?
No. The page reads files you choose from your own disk, and it does not fetch video from a web address. Download the file first, then choose it here.