#427 Resampling ruins end of audio loop

Unknown (40)

Before encoding, the loop plays back smoothly; after, there seems to be a half-second gap at the end.

The command I'm using is:
lame -q 0 -V 8 -b 32 -B 320 --resample 44.1 -m j music.wav music.mp3

I've tried all sorts of variations of the above. The output file must be 44100hz so that Adobe Flash will accept it for import.

WAV and MP3 files:


  • Steven Vachon

    Steven Vachon - 2012-08-09

    Actually, it adds the silence to the BEGINNING of the mp3 file, not the end.

  • Anonymous - 2012-08-15

    This should be expected. The technical FAQ explains this: http://lame.sourceforge.net/tech-FAQ.txt

  • Steven Vachon

    Steven Vachon - 2012-08-16

    Oh, my bad. I just read through the part of the technical FAQ that pertains to my issue, and I'm not really sure what the solution would be. Can ENCDELAY have a value of 0? If so, why doesn't it already to avoid this issue?

  • Anonymous - 2012-08-16

    As far as I know, this cannot be avoided. There's a popular page people point to: http://www.compuphase.com/mp3/mp3loops.htm that talks about making loop-able MP3 tracks, but it's quite involved, the program didn't work for me, and it sacrifices audio quality, from my understanding.

    Sorry to do a shameless plug, but I'm actually working on a program that'll let you compile your MP3s into an SWF file and it'll handle take care of this gap for you (SWF files just skip these silent samples... long story). If you're interested, I can let you know when I have a working pre-alpha version (hopefully by the end of this weekend). I'd be happy to have a tester :)

  • Steven Vachon

    Steven Vachon - 2012-08-16

    Hmm, well, I just did sound.play(124, 999999) and it skips over the gap every time. Is this basically what your SWF file would do, or does it remove the silence from the MP3 itself?

  • Anonymous - 2012-08-16

    It skips the gap (the delay added to the beginning and end). It doesn't remove it. My goal is sample exactness though, so it's a bit more complicated than just play(someTime, 0).

    Anyway, I hate to keep having a full discussion on a bug tracker about this. Send me a message if you want more details, as I don't want to keep spamming people with Flash talk.

  • Steven Vachon

    Steven Vachon - 2012-08-16

    sf says I can't send you a message 'cuz you haven't provided an email address.. ?

  • Thomas Orgis

    Thomas Orgis - 2012-08-16

    mpg123 should play the loop encoded by LAME just fine (or any program using libmpg123). I spent quite some effort on getting that right (skipping samples at beginning and end; sample-accurate seeking).

    You can actually check using mpg123's --loop parameter.

    (Disclaimer about strange bugs applies;-)


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