#440 -V flag desynchronizes audio


Potential bug involving -V flag.

The issue is probably difficult to reproduce, as I've used LAME without any problems for a long time, until this issue came up.

I mixed 2 wav files together in Audacity. One was audio from a game, the other was voice commentary. I saved the result as a wav file.

I then encoded the wav file into an mp3 file using: 'lame file.wav -m j -q 1 --lowpass 19.7 -V 5'. Upon testing the resulting mp3 against the video (which the game audio was ripped from), I noticed that the audio had desynchronized from the video after a short time. When I play the wav file with the video, it is synchronized.

I then played the audio on it's own, comparing it to the wav file. The mp3 was different from the wav file.

I then downloaded the latest Windows 64 bit version of LAME (LAME 3.99.5 64bit), and tried again. The same problem occurred.

I then tried various encoding settings with lame:

'lame original.wav -m j -q 1 --lowpass 19.7 -V 5' BAD
'lame original.wav' GOOD
'lame original.wav -m j -q 1 --lowpass 19.7' GOOD
'lame original.wav -V 5' BAD
'lame original.wav -V 1' BAD
'lame original.wav -V 0' BAD
'lame original.wav -V 9' BAD
'lame original.wav -V 5 -t' This one is strange. It desynchs randomly. I can also sometimes hear the audio slowing down and speeding up in VLC. The players also keep changing their mind about how long the track is. The number keeps going up and down.
'lame original.wav -V 5 -t -F' also behaves strangely.

I tested the audio using the following programs: VLC (downloaded the latest version specifically to test this), MPC-HC, Windows Media Player. All of them had desynchronized audio. However, Audacity played all of the audio files correctly. This makes me think that there is a bug in the decoding, rather than the encoding.

The files seem to desynch around the middle, but then return to normal towards the end. The files all seem to have the same total length.

You can get my files from: http://garosoft.org/samplefiles.7z
(SourceForge won't let me attach the file normally for some reason).

The best way that I've found to test the files is to skip to 4:50, and listen for the sound of the door shutting, and compare that time between the different files. In the good files, the door shuts at 5:01. In the bad files, the door shuts at 4:58.

Hopefully other people will be able to confirm these results. I am running Windows 7 64 bit. My Audacity version is 2.0.2. I tried using Audacity 2.0.3 but had the same problem.

1 Attachments


  • Ryan

    Ryan - 2013-06-22

    I had a look around, and I think I got a bit ahead of myself. This is probably just a standard problem with most media players when dealing with VBR. I muxed the mp3 with FFMPEG, and it synchronised itself fine. Also, foobar2000 plays the files correctly. Therefore, there is probably no problem with LAME itself.

  • Robert Hegemann

    Robert Hegemann - 2017-08-08
    • status: open --> closed-wont-fix

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks