Sound effects, measured to the sample
MP3 silence at the beginning: why your sound effect starts 25 ms late

Short answer
The silence is encoder delay, not part of your sound. Every MP3 in our test, from the free converter and from ffmpeg, started with 1,105 extra samples: 25.1 ms at 44.1 kHz, 23.0 ms at 48 kHz. The file also records that number in a LAME tag, and ffmpeg, Chromium 153 and Firefox 157 used the tag to give back the WAV's exact length. A player that ignores the tag, or an MP3 written without one, starts 25.1 ms late; a looped click track then gained 37.6 ms of silence at every repeat. So check the file for the tag before you trim anything, and if it has none, encode the WAV again to a file.
Key takeaways
- Check the file before you trim anything: python3 lametag.py effect.mp3 prints delay=576 and the padding when the tag is there, and "no Info/Xing tag" when it is not. ffprobe shows the same thing as start_time=0.025057.
- All five converter MP3s carried the tag. In ffmpeg, Chromium 153 and Firefox 157 (Web Audio decodeAudioData), each one decoded to exactly the WAV's sample count, with the sound at the same sample as in the WAV.
- The silence appears when the tag is ignored or missing. ffmpeg told to ignore it played 1,105 samples before the sound and 321 to 840 after it. MP3s that ffmpeg wrote to a pipe or with -write_xing 0 had no tag, and all four decoders played the extra samples.
- The converter's MP3s were 6.1% to 9.5% of the WAV size, 10.5 to 16.4 times smaller. The tag itself costs 182 to 208 bytes.
- For loops: a click-track MP3 without the tag drifted 1,656 samples (37.6 ms) at each repeat in Web Audio. Setting loopStart and loopEnd around the delay made it exact again. If you cannot test the player that will loop the sound, ship the WAV.
Is the silence in your file, or in your player?
You dropped an MP3 sound effect on a timeline or into your app, and it lands a beat late, or it hiccups every time it loops. Before you trim anything, find out where the gap lives. Every MP3 has the delay; what differs is whether the file says how long it is, and whether your player reads that. A waveform with a gap at the start shows only what that program decoded. In our test the same file decoded with or without the gap depending on whether the decoder read its tag: ffmpeg, Chromium and Firefox read it and played no gap; ffmpeg with the tag switched off played the gap.
Two commands settle it. The first reads the tag with lametag.py, a short Python script you can download below this section (standard library only). The second asks ffprobe, which comes with ffmpeg.
If you see delay=576, the file is fine and your player decides. ffmpeg, Chromium and Firefox removed the delay and the end padding in our test. If the player you use still starts late, it ignores the tag; see the loop section for a fix in code. If you see "no Info/Xing tag", nothing tells the player about the delay, and every decoder we tried played it. Encode again from the WAV to a file, with the converter or the ffmpeg command below; both wrote the tag in every run.
python3 lametag.py effect.mp3ffprobe -v error -show_entries format=start_time -of csv=p=0 effect.mp3Free tools:Download lametag.py, the tag reader used aboveConvert a WAV sound effect to MP3 in your browser

Why does converting WAV to MP3 add silence at the start?
Because MP3 encodes sound in frames of 1,152 samples, and neither the encoder nor the decoder can start cold. The LAME technical notes (Mark Taylor, June 2000) put the encoder delay at 576 samples by default ("The default right now is 576"), and say of the decoder side: "All *decoders* I have tested introduce a delay of 528 samples." The end gets padding too: "If the number of samples is not an exact multiple of 1152, then last frame of data is padded with 0's".
Our files show the sum. The tag stores delay=576, and ffmpeg skipped 1,105 samples, so it counts 529 for its decoder, one more than the notes' 528. Every file at both sample rates had the same 1,105 samples. The padding at the end depends on the length of the sound: 850 to 1,369 samples in the tag for our five files.
The fix for this was built in long ago. The same notes explain: "LAME embeds the amount of padding in the ancillary data of the first frame of the MP3 file." The info tag specification describes the field as "how many samples were added at start (encoder delay) in X and how many 0-samples were padded at the end in Y to complete the last frame". A player that reads it can cut both ends and play exactly the WAV's samples. That is what gapless playback means.
The tag has one weak spot, and it matters if you encode in scripts. ffmpeg's documentation says the Xing/LAME frame "is enabled by default, but will be written only if the output is seekable". Writing to a pipe is not seekable. Our five MP3s piped to stdout had no tag, exactly like the ones made with -write_xing 0.
Which players skip the delay, and which play it?
We decoded every MP3 four ways and lined each result up with its WAV, sample by sample (cross-correlation of the mono mix). The click track is the control: its first click sits at sample 11,025 of the WAV, so any shift shows up as an exact number. Each WAV decoded by the same decoder came out with no shift and the same length, so the method adds nothing of its own.
| Decoder | MP3 with the tag (converter or ffmpeg to a file) | MP3 without the tag (piped, or -write_xing 0) | WAV (control) |
|---|---|---|---|
| ffmpeg 6.1.1, default | 0 / 0 in 5 of 5 | 1,105 / 321 to 840 | 0 / 0 |
| ffmpeg 6.1.1, -flags2 +skip_manual (ignores the tag) | 1,105 / 321 to 840 | 1,105 / 321 to 840 | 0 / 0 |
| Chromium 153, Web Audio decodeAudioData | 0 / 0 in 5 of 5 | 1,105 / 321 to 840 | 0 / 0 |
| Firefox 157, Web Audio decodeAudioData | 0 / 0 in 5 of 5 | 1,105 / 321 to 840 | 0 / 0 |
Measured November 29, 2026.
The end padding is the tag's padding minus the 529 samples the decoder already accounts for. It ran from 321 samples (7.3 ms, bicycle bell) to 840 (19.0 ms, karabiner click). It matters only when sounds play back to back or loop.
What we did not measure: Safari or any WebKit browser (the test build would not start), playback through an HTML audio element, game engines, video editors and phones. A player not in the table may do either. To test yours, play the three click-track files linked in the sources: the WAV, the MP3 with the tag and the MP3 without it. If the tagged MP3 drifts in a loop and the WAV does not, your player ignores the tag.

How much smaller is the MP3 than the WAV?
About ten times for a 16-bit stereo effect, about sixteen times for a 24-bit one. The converter writes 128 kbps for stereo and 64 kbps for mono, whatever the WAV's bit depth, so a 24-bit WAV, half as large again per second, shrinks more.
| Sound (licence) | WAV format and length | WAV bytes | MP3 from the converter | MP3 bytes | MP3 as % of WAV |
|---|---|---|---|---|---|
| Click track (made by make-click.py) | 16-bit stereo, 44.1 kHz, 2.000 s | 352,844 | 128 kbps stereo | 32,853 | 9.3% |
| Karabiner click (CC0) | 16-bit stereo, 44.1 kHz, 1.158 s | 204,232 | 128 kbps stereo | 19,479 | 9.5% |
| Knock on door (CC0) | 16-bit mono, 48 kHz, 3.712 s | 356,430 | 64 kbps mono | 30,189 | 8.5% |
| Bicycle bell (CC0) | 24-bit stereo, 44.1 kHz, 1.483 s | 392,384 | 128 kbps stereo | 24,494 | 6.2% |
| Sleigh bells (CC0) | 24-bit mono, 44.1 kHz, 9.812 s | 1,302,830 | 64 kbps mono | 79,340 | 6.1% |
Bytes are exact; the ffmpeg command made files of the same size.
The converter's files and the ffmpeg files were the same size, and only 9 bytes differed, all before the first audio frame: the encoder version written in the tags (Lavf59/Lavc59 in the converter, Lavf60/Lavc60 in ffmpeg 6.1.1) and the bytes that depend on it. The audio frames were identical. One edge input: the 24-bit sleigh-bells WAV ends with one stray byte. ffmpeg printed "Invalid PCM packet", exited 0 and made a 79,340-byte MP3 like the converter's, differing only in the same 9 tag bytes.
The tag is cheap: the same encodes without it were 182 to 208 bytes smaller. That is not worth saving on a sound effect that has to start on time.
ffmpeg -i effect.wav -vn effect.mp3How do I loop an MP3 sound effect without a gap?
Give the loop a file whose length the decoder knows. In Chromium at 44.1 kHz, the tagged click-track MP3 decoded to 88,200 samples, the same as the WAV, and a plain Web Audio loop kept its clicks exactly 22,050 samples apart through three passes, across both loop points. In a 48 kHz context it decoded to 96,000 samples and the clicks stayed 24,000 apart: the same 0.5 s.
The same sound written without the tag decoded to 89,856 samples. Looped as is, the clicks were 22,050 apart inside each pass and 23,706 apart across each loop point: 1,656 samples (37.6 ms) of silence per repeat, the 1,105 at the start plus 551 at the end. If you cannot re-encode the file, tell the loop where the real sound is.
Do not apply this to a file that has the tag. In a decoder that already trimmed it, loopStart would cut 25 ms of the real sound. Run lametag.py first. And the 1,105 is what LAME and ffmpeg produced in this test; another encoder may use another delay, which you can read from its tag or measure with the click track.
Engines and players that loop on their own, outside Web Audio, were not tested here. If you cannot set loop points and cannot test the player, use the WAV for anything that loops.
const buf = await ctx.decodeAudioData(mp3Bytes); // resampled to ctx.sampleRate
const src = ctx.createBufferSource();
src.buffer = buf;
src.loop = true;
// Only for an MP3 WITHOUT the tag: skip the delay, stop at the original length.
const fileRate = 44100; // the WAV's sample rate, NOT buf.sampleRate
const delay = 1105; // samples, measured for LAME/ffmpeg encodes
const length = 88200; // samples in your WAV (88200 = our 2 s click track)
src.loopStart = delay / fileRate;
src.loopEnd = (delay + length) / fileRate;
src.connect(ctx.destination);
src.start(0, src.loopStart);What if the WAV itself starts with silence?
Then the MP3 keeps it, and no tag helps. Our knock-on-door WAV (48 kHz) has 1,336.4 ms before its first sample at -40 dBFS. That is a pause in the recording, 58 times longer than the encoder delay (23.0 ms at 48 kHz), and it came through every encode unchanged. Trim the WAV first, then convert.
The free Remove silence tool is not the right fit here. It removes every stretch quieter than -40 dB, at the start, the end and in between, and writes an MP3: our 3.712 s knock came out as 0.099 s of sound (4,738 samples; the MP3 itself reports 0.144 s because the 576-sample delay and 1,598-sample padding are included), against 2.376 s from the command below, because everything under -40 dB after the first knock went as well. To cut only the lead-in and keep a WAV for the conversion, use this command:
A trim like this cuts the silence in the recording; the MP3 delay comes back with every encode. If the start of the sound is a sharp attack, check the edge after trimming. Cutting into a sound can click, and the guide on cutting audio without a click shows the 10 ms fade that fixes it.
ffmpeg -i effect.wav -af silenceremove=start_periods=1:start_threshold=-50dB:detection=peak effect-trimmed.wavWhen should I keep the WAV instead?
The MP3 with its tag played exactly in every decoder we tested, so for one-shot sounds in a browser or an ffmpeg pipeline it is the smaller, safe choice. Keep the WAV when one of these is true:
- The sound loops in a player you have not tested and you cannot set loop points. 37.6 ms per repeat is a gap, not a nuance.
- Timing has to hold to the frame and you do not control the decoder. 25.1 ms is 1.5 frames at 60 fps (16.7 ms per frame).
- The file goes through a tool that writes MP3 to a pipe or strips tags. Check it with lametag.py after the tool, not before.
- Size does not matter for this sound. The karabiner click is 204,232 bytes as WAV and 19,479 as MP3; for a few dozen effects that difference may not be worth a timing risk.
Free tool:Convert the one-shot sounds, keep the loops as WAV
What we did not test, and what the test shows
Five sounds, one encoder family and four decoders. Read the numbers as what happened to these files. Each row says what changed and what stayed fixed.
| Claim | Varied | Held equal | Why |
|---|---|---|---|
| The delay is 1,105 samples | Sound, 16 or 24 bit, mono or stereo, 44.1 or 48 kHz, 64 or 128 kbps | LAME via ffmpeg (6.1.1 and the converter's build) | The loop fix needs the exact number |
| Tag-aware decoders remove it | Decoder: ffmpeg, Chromium, Firefox | The same five tagged files | Tells you the file is fine and the player decides |
| Without the tag, every decoder plays it | How the file was written: pipe or -write_xing 0 | Same encoder settings | Shows the tag, not the audio, makes the difference |
| loopStart/loopEnd remove the loop gap | Plain loop vs loop points | Click track, Chromium 153 | Gives a fix when you cannot re-encode |
| WAV control shows no shift | Nothing: known answer | Same decoders and analysis | Proves the measurement adds nothing |
Claim, what was varied, what was held equal, and why it matters.
What this does NOT prove: anything about Safari, HTML audio elements, game engines, video editors, phones or hardware players (none were tested), or about encoders other than LAME. It also says nothing about how the sounds sound: no listening test was run. The analysis compared samples. In all four decoders, each decoded WAV matched itself with no shift and the same length.
Do it in your browser
Free Koldflux tool, no account needed.
Questions people ask
Why does ffprobe show a start time of 0.025057 for my MP3?
That is the encoder delay read from the tag: 1,105 samples ÷ 44,100 per second = 0.025057 s. At 48 kHz it shows 0.023021. ffmpeg skips that much when it decodes, so the sound itself starts at 0. A file without the tag shows 0.000000 and plays the delay.
Can I cut the silence out of the MP3 itself?
Not cleanly. The delay is part of how the first frame decodes, and an MP3 cut copies whole frames. The guide on cutting audio without a click measured copy cuts that decoded with 897 to 1,554 leading zero samples. Trim the WAV, encode once to a file so the tag is written, and let the player use the tag.
Is the delay different at 48 kHz?
The same 1,105 samples in our 48 kHz knock, which is 23.0 ms instead of 25.1 ms, because each sample is shorter.
How do I keep the tag when I convert in a script?
Write to a file, not to stdout. ffmpeg writes the tag only to seekable output: our five MP3s piped with -f mp3 - had none, while the same command writing effect.mp3 had it every time. -write_xing 0 removes it on purpose, so leave that option out.
Does a mono or 24-bit WAV change the delay?
Not in this test. The 16-bit and 24-bit, mono and stereo files all had 1,105 samples of delay. Only the end padding changed, because it depends on the length of the sound.
Related
More guides on this topic
Sources and how we checked
- LAME technical FAQ, Mark Taylor, June 2000: encoder delay 576, decoder delay 528, LAME info tag, end padding (checked 2026-11-29)
- Mp3 info tag specification: encoder delay and padding field (checked 2026-11-29)
- FFmpeg Formats Documentation: mp3 muxer, Xing/LAME frame written only to seekable output, write_xing (checked 2026-11-29)
- FFmpeg Codecs Documentation: flags2 skip_manual (decode without skipping the delay) (checked 2026-11-29)
- Wikimedia Commons: karabiner click by Rudmer Rotteveel (originally Freesound 457456), CC0 (checked 2026-11-29)
- Wikimedia Commons: Knock on door.wav by Asud12, CC0 (checked 2026-11-29)
- Wikimedia Commons: Bicycle-bell-1.wav, Soundscape Leuphana, CC0 (checked 2026-11-29)
- Wikimedia Commons: Sleigh bells.wav by The Midnite Wolf, CC0 (checked 2026-11-29)
- Test files for your own player: click track WAV (clicks at samples 11025, 33075, 55125, 77175) (checked 2026-11-29)
- Test files: the click track as MP3 with the tag (from the converter) (checked 2026-11-29)
- Test files: the click track as MP3 without the tag (ffmpeg -write_xing 0) (checked 2026-11-29)
- Our test log: sizes, tags and every decoder comparison (test-results.txt) (checked 2026-11-29)
- Test script that rebuilds every number (test-run.sh, with analyze.py, browser-decode.cjs, loop-test.cjs) (checked 2026-11-29)
- Every published command with its exit code and edge inputs (commands.log) (checked 2026-11-29)
- Tag reader for your own files (lametag.py) (checked 2026-11-29)
On November 29, 2026 we took four CC0 sound effects from Wikimedia Commons and a click track made by script with clicks at known samples. All five were converted with the live Koldflux WAV to MP3 tool in headless Chromium and with ffmpeg 6.1.1 using the same arguments, and again with ffmpeg writing to a pipe and with -write_xing 0. Every MP3 and WAV was decoded by ffmpeg (default and -flags2 +skip_manual) and by Web Audio decodeAudioData in Chromium 153 and Firefox 157. Each decode was lined up with its WAV by cross-correlation to count extra samples at both ends. The LAME tag was read with lametag.py, a looped click track was rendered in an OfflineAudioContext at 44.1 and 48 kHz, and every published command was re-run with edge inputs (commands.log). The LAME notes, the info tag specification and the FFmpeg documentation were read the same day. WebKit could not be started and was not tested; no listening test was run.