Page 1 of 1

(Help)It is impossible to make a Loop with mp3

Posted: Mon Dec 14, 2020 8:49 pm
by Zephy
I learned that the mp3 codec will always add a few milliseconds of silence to the beginning and end of the file when it compresses. You can have a perfect seamless loop as a WAV file but it will no longer be perfect when it's turned to mp3.
Screen Shot 2020-12-14 at 4.35.21 PM.png
See the two files above should be identical but you will see the Green Mp3 file has a few seconds of deadspace added to it.

As a composer how do you deal with this issue? Do you just not use mp3 or other lossy codecs? Do you use an application to trim it in the export?

Screen Shot 2020-12-14 at 4.40.51 PM.png

Re: (Help)It is impossible to make a Loop with mp3

Posted: Mon Dec 14, 2020 11:24 pm
by Imperf3kt
I've never experienced this, it's not part of the LAME codec as far as I am aware.

What program are you using to do the conversion?

Re: (Help)It is impossible to make a Loop with mp3

Posted: Mon Jan 04, 2021 10:41 pm
by Zephy
The LAME codec is one of the codecs that does not do this. Im doing my conversions in Izotope Ozone when I master the tracks.

Re: (Help)It is impossible to make a Loop with mp3

Posted: Mon Jan 11, 2021 8:39 am
by FulminisIctus
As a composer how do you deal with this issue? Do you just not use mp3 or other lossy codecs? Do you use an application to trim it in the export?
The standard audio format that's usually used is .ogg (not just because it loops seamlessly but also because you don't have to worry about license stuff, as opposed to .mp3). You'd need an encoder that tells the decoder when the actual audio starts, as well as a decoder that can read and execute those instructions if you really want to use mp3.
I've never experienced this, it's not part of the LAME codec as far as I am aware.
LAME adds silence as well as far as I know (my info might be old on that), but adds a tag for decoders so they know how to skip/trim the silence (that's called "gapless playback"). I don't think renpy supports gapless playback, but don't quote me on that.

There's software out there that can trim MP3 files like mpTrim https://www.mptrim.com/ but there isn't usually really a reason to use mp3s instead of oggs.

Re: (Help)It is impossible to make a Loop with mp3

Posted: Thu Feb 18, 2021 4:36 pm
by makeawish
Yes, I had the same issue on a loop track I saved in MP3, and after saved in .ogg this was fixed. :)

Re: (Help)It is impossible to make a Loop with mp3

Posted: Thu Feb 18, 2021 8:42 pm
by Imperf3kt
FulminisIctus wrote:
Mon Jan 11, 2021 8:39 am
you don't have to worry about license stuff, as opposed to .mp3
Just clearing this up that the MP3 format has not required licensing since 2017 when the patent expired and was not renewed.

Re: (Help)It is impossible to make a Loop with mp3

Posted: Fri Mar 05, 2021 11:39 am
by FulminisIctus
Imperf3kt wrote:
Thu Feb 18, 2021 8:42 pm
Just clearing this up that the MP3 format has not required licensing since 2017 when the patent expired and was not renewed.
Oh dang, that's great. Thank you for the correction!