Apparent bug exporting long generated silences

I’ve found what looks very like a bug in exporting long generated silences. I have a 15 minute track and I want to insert 15 minutes of silence near the end. It I generate a 5 second silence at 14:30 and export, all is good and the exported track plays as expected ie with 5 seconds of silence in the right place.
If however I insert 15 minutes of silence and export, then it plays all wrong. The silence which should start at around 14:30 doesn’t start until around 23 or 25 minutes (it varies) and only lasts 5 or 8 minutes. A large part of the initial 14:30 minutes of music gets repeated to fill the gap between 14:30 and approx 23/25 mins where silence ought to be.
I can’t see anything I’m doing wrong. Inside Audacity the track looks and sounds perfect.
I’ve tried with 3 different 15 minute tracks, and I’ve played the results with 3 different players including VLC and Windows Media Player. This looks very like a bug - anyone got any thoughts please?
This help topic replaces my previous post:

which didn’t attract replies, probably because I didn’t realise it was a bug.

That is worrying. I’ll DM you; please send me the project that exhibits this behavior.

OK, there’s definitely something off here.

The good news: If I import the file back into Audacity, OcenAudio, Audition or play it in Chrome, everything shows up correctly.

The bad news: If I open it in VLC or Windows Media Player, it doesn’t. If I play it in Firefox, it works just fine until I start skipping around, in which case the entire thing is always silent.

I suspect the VBR in combination with the strong contrast between the first half (music content) and the second half (just a bunch of zeroes, which are a lot easier to encode) is throwing something off. VLC reports the entire file being 32 kbps, while it actually is supposed to be 118 kbps.

Wild.

I have a suspicion that it’s only the seeking that’s broken though. I’d expect playback to be OK still for all of these programs. Playing back in VLC as I type this. Thanks for sending a file this pleasant to listen to :slight_smile:


yeah, it goes silent somewhere here, and while the playback time is correct, the progress bar, tooltip and seeking is broken

Ok, I now understand what’s going on here.

MP3 files don’t exist as such. MP3 is a broadcast format, and what we call an “MP3 file” is actually a loose collection of MPEG frames, each associated with an arbitrary amount and placement of tags. The only indication that the file you’re looking at is MP3 is that periodically you’ll find the frame sync (which is just 11111111111, so this post is now a valid MP3 file).

Your file has content in the first half, and no content in the second half. This means that in the first half each frame contains more data, while in the second half, they contain pretty much no data at all.

Since MP3 doesn’t have a header and the frames can contain as much or as little data as they want, media players don’t really know where to start looking if you want to skip to the 50% of the video. So they do the next best thing and skip to 50% of the data and then look at the next available frame. Usually this works well enough; a frame is 40ms in length and skipping to some place ± 2 seconds is probably good enough. But in your case, 50% of the data is maybe 20% of your content, causing the player to massively miss on seek.

This is also why audio editors work fine: They need to read the file end to end anyway to begin with when importing to generate the waveform, so they can figure out what’s what at that point.

Your solution then would be:

  • Export the file with a constant bitrate, instead of variable bitrate. This will make your file larger, but will make the frames more predictable.
  • Use a different format than MP3.
  • Insert quotes from the Bible, Tolstoy, or some other data of your choice in-between the data frames in the second half of your file. (this is a joke, but it would probably work)

That makes sense. (Plus always interesting to know what’s inside files types.) I’ll check out your suggestions and report results, though won’t be until the weekend as “Bible” and “Tolstoy” are new to me so will take me until then to download and read tham.

This topic was automatically closed after 30 days. New replies are no longer allowed.