INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Gapless Encoding & Playback  (Read 5539 times)

johnc12

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • nothing more to say...
Gapless Encoding & Playback
« on: July 06, 2003, 04:24:16 am »

I have noticed that even when selcting gapless playback in MC 9, sometimes there is still an audible split between songs on playback.  I did some research and found that the lame encoder has a --gapless switch which adresses this problem.  So I encoded a CD using the --gapless option and it helped but not completely.  So, I have a few questions which hopefully someone can answer:

1. Can you truely have gapless playback with MP3s?
2. Gapless playback seems to be a function of both encoding and playback.  With MC9, it comes real close since MC9 prefectches the next track and, from what I can tell, attempts to splice the 2 tracks together seemlessly.  Playback on on iPod still has gaps, since it doesn't appear the iPod does anything in that regard. So, do any hardware MP3 players fix this?  Does anyone have or know of a H/W MP3 player that seemlessly transitions from one song to the next?
3. Should MC9 have support for --nogap when encoding MP3s? I would think so, since the alternative is to do the encoding in a DOS window (not very user friendly).
4. Any other comments/thoughts on how to get encode/playback MP3s without gaps between songs?

This problem is most noticeable in "live" albums or other CDs where one track fades right into the next.  It would be nice to have a way to play these CDs without an annoying pause between each track.
Logged

RemyJ

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1249
Re: Gapless Encoding & Playback
« Reply #1 on: July 06, 2003, 10:18:48 am »

I can't answer the questions about truely gapless with MP3 (try a google search on "mp3 gapless") or the iPod but...

You can add any Lame option you like if you select "Custom" as the encoder quality and press the "Advanced" button.

In Playback settings, try using "Cross-fade (Smooth)" with a duration of 0.1 s and try playing with the "Do not play silence..." setting.   I gan get it to the point where I can play Pink Floyd's Dark Side of the Moon and not notice the gaps.

Also, if you have reply gain turned on in the DSP, you night not hear a gap, but you might hear a volume shift as replay gain does its thing.

Logged
Fedora 40 x86_64 Xfce

johnc12

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • nothing more to say...
Re: Gapless Encoding & Playback
« Reply #2 on: July 06, 2003, 11:48:05 am »

Thanks.  I'll try some of your suggestions.

As for the Custom encoder option, it won't work.  The --nogap option to LAME needs ALL the files passed to it at the same time, rather than calling LAME each time for each file.  So, in order for this to work, MC would need an option to rip an entire CD to .wav files and then pass them to LAME with the --nogap option as a single command line.  Like I said, it can be done manually, but it is a bit of a pain and I'd rather see it incorporated into MC as an option when using the LAME encoder.  
Is there any formal way to request enhancements, or does the moderator troll these posts looking for suggestions?
Logged

Wobbley

  • Regular Member
  • World Citizen
  • ***
  • Posts: 216
  • What a bum rap for a nice, sensitive guy like me
Re: Gapless Encoding & Playback
« Reply #3 on: July 07, 2003, 10:52:41 am »

JohnC,

Someone will troll the posts, but just in case, maybe post again with "Feature request" in the thread title...just an idea...

Anyway,  I'd like to help you pursue this because I have the same problem and would like to be able to rip my mixed CDs (DJ CDs where the mix is actually one big song) and have them playback as they were intended to be heard, especially on the iPod.  I've tried the gapless setting too in LAME and it works better than without, but not perfectly as I want.

Wobbley
Logged

gkerber

  • Guest
Re: Gapless Encoding & Playback
« Reply #4 on: July 07, 2003, 03:45:12 pm »

When I first got MJ, I experimented with mp3 and was never ever able to get total gapless track transisitions.  That pushed me over the edge to go with ape encoding, gapless works perfectly with ape.
Logged

lalittle

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3964
Re: Gapless Encoding & Playback
« Reply #5 on: July 07, 2003, 07:57:23 pm »

Does ape work with the iPod?

Thanks,

Larry
Logged

kiwi

  • Citizen of the Universe
  • *****
  • Posts: 817
  • Don't worry, be happy...
Re: Gapless Encoding & Playback
« Reply #6 on: July 07, 2003, 10:38:00 pm »

APE does not work with the iPod, just WAV, MP3 and ACC? (mp4).  

For dj mixes, you could rip as one big APE, with CUE sheet, create your APL files and presto, it should be gapless.   And you have your original file, so you could just listen to the one file if you wanted to listen to the whole file.

note, I haven't played with this too much, since I don't have too many CDs where I want to have them as one big file.

Could you rip to one APE, and then use that with the --gapless option in LAME?  If it could also use a cue sheet?

kiwi
Logged

lalittle

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3964
Re: Gapless Encoding & Playbac
« Reply #7 on: July 08, 2003, 12:25:43 am »

The thing that I find most frustrating in all this is that it's quite easy to implement gapless playback of mp3's.  Unfortunately, most manufacturers of mp3 apps/players (as well as most consumers) just don't feel that this is "necessary," so they just don't bother to offer it.

Larry
Logged

kiwi

  • Citizen of the Universe
  • *****
  • Posts: 817
  • Don't worry, be happy...
Re: Gapless Encoding & Playbac
« Reply #8 on: July 08, 2003, 05:07:23 am »

Quote
The thing that I find most frustrating in all this is that it's quite easy to implement gapless playback of mp3's.  Unfortunately, most manufacturers of mp3 apps/players (as well as most consumers) just don't feel that this is "necessary," so they just don't bother to offer it.


Is it easy to implement?  I would imagine that it might not be so easy given the hardware restraints that the portables work with.  Maybe a new controller might be needed.  Or the firmware might need to be different.  Or the audio processor might need to be more powerful... or you might need a second processor since the current one can only decode one stream at a time.

I don't know exactly how one would implement a gapless player, but i imagine that it would require decoding the last of the 1st MP3 and the beginning of the 2nd mp3 at the same time.  Or at least decoding and buffering and then merging.  I would imagine that this would drive the cost of a system up by a significant bit.  (i.e. $1-5 or more on a $80-120 device.)

kiwi
Logged

johnc12

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • nothing more to say...
Re: Gapless Encoding & Playback
« Reply #9 on: July 08, 2003, 07:22:10 am »

Actually, I don't think it would be too hard to implement.  The key is to keep the playback cache full, so you would need to start filling in the cache with the second song while the first is playing, but this is already the case with most players.  I think it has more to do with how they handle the transition from one song to the next.  As near as I can tell, given my limited expertise in this area, each MP3 has some header info in the beginning of the file. I suspect that most players read this header info, process it (causing the playback gap) and then begin playing the track.  The key would be to splice multiple tracks together in the playback buffer and stripping out this header info.  My guess is an assumption would have to be made that all the MP3s spliced and played this way would need to be the same (i.e., same sampling rate, etc.).  Again, I don't see this as a huge issue as MP3 is basically a streaming format from what I can tell.

I did some more testing in MJ 9 and it seems like just setting the "don't playback silence at the beginning & ending of songs" plays as close to gapless as it gets.  I didn't notice it being any better or worse when encoding --gapless with LAME.  I played back tracks enoded and not encoded with --gapless and they all played quite well with no notiable transition between tracks.

I think in terms of the iPod, Apple need to enhance the firmware to playback without gaps.  I have submitted a request concerning this, but I'm not sure how big an issue it is for them.
Logged

lalittle

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3964
Re: Gapless Encoding &
« Reply #10 on: July 08, 2003, 12:43:36 pm »

Quote


Is it easy to implement?  I would imagine that it might not be so easy given the hardware restraints that the portables work with.  Maybe a new controller might be needed.  Or the firmware might need to be different.  Or the audio processor might need to be more powerful... or you might need a second processor since the current one can only decode one stream at a time.


Look at the fact that software mp3 players, which have VASTLY more than enough processing power to achieve gapless playback on current systems don't bother to do implement this feature.  I know of one or two plugins that make this possible on players like Winamp, but it's not even a native capability.  This clearly demonstrates that it's an incredibly low priority.

As far as portable players go, it's already been done on some players.  I don't know whether or not it's possible to add this to the EXISTING iPods -- I was referring to designing the thing to do it in the first place.  That said, the iPod already DOES decode and buffer more than one song at a time.  Given all the memory that player has -- enough to buffer close to 30 minutes of averaged sized mp3's from what I've read -- it most likely would have been relatively simple to design it to buffer the tag info at the time it buffers the songs such that it doesn't need to buffer this info at the time the song itself loads (which, as I understand it, is what causes the gap.)  The player has the ability to continue to allow screen navigation while a song is playing, so merely loading a new screen without causing a gap is obviosly not a problem.

Once again, the only reason it doesn't do this is because this isn't the way mp3 players were originally designed to work, and 'almost' nobody has bothered to change this.  I would bet that apple never even looked into making the iPod gapless since most software mp3 players, which CAN do this VERY easily, don't even offer it.  I would guess their response would be "it's essentially gapless such that most people don't notice the gap," which is of course true on most pop albums that don't blend songs together.

Larry
Logged

gkerber

  • Guest
Re: Gapless Encoding & Playback
« Reply #11 on: July 08, 2003, 01:32:55 pm »

Quote
Once again, the only reason it doesn't do this is because this isn't the way mp3 players were originally designed to work, and 'almost' nobody has bothered to change this.  I would bet that apple never even looked into making the iPod gapless since most software mp3 players, which CAN do this VERY easily, don't even offer it.  I would guess their response would be "it's essentially gapless such that most people don't notice the gap," which is of course true on most pop albums that don't blend songs together.

I'd guess (and I am guessing) that the gapless code would have to be implemented for encoding, not playback.
Logged

johnc12

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • nothing more to say...
Re: Gapless Encoding & Playbac
« Reply #12 on: July 08, 2003, 02:42:01 pm »

Actually, I think gapless play can be accomplished without doing any special encoding.  MC9 does a real good job playing back without gaps for normally encoded MP3s, if you set the playback option accordingly.
Its a shame thereisn't an open source firmware movement for the iPod like there is for the Archos MP3 player (http://rockbox.haxx.se/).  Given the popularity of the iPod and the fact that its been around for years, it would be nice to have an Open Source option for others to address some of these limitations.  Its doubtful Apple will look into gapless playback, especially if they don't perceive a need to do it!
Logged

lalittle

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3964
Re: Gapless Encoding & Playback
« Reply #13 on: July 08, 2003, 04:27:43 pm »

Quote

I'd guess (and I am guessing) that the gapless code would have to be implemented for encoding, not playback.


It has already been proven that this is NOT an encoding issue, but rather a playback issue.  As already stated, other mp3 apps (like Winamp with the gapless plugin) and at least one portable mp3 player offer gapless playback with standard mp3 files.

Larry
Logged

lalittle

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3964
Re: Gapless Encoding & Pla
« Reply #14 on: July 08, 2003, 04:57:44 pm »

Quote
 MC9 does a real good job playing back without gaps for normally encoded MP3s, if you set the playback option accordingly.


My experience is that MC9, while fast, is still not gapless.  By setting the crossfade options you can create a sort of "pseudo-gapless" playback, but how good it sounds depends on the actual songs, and it's still definitely not the same as the truly gapless playback you get with actual CD's, tapes, or vinyl.

Larry
Logged

rocketsauce

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1059
Re: Gapless Encoding & Playback
« Reply #15 on: July 08, 2003, 11:33:12 pm »

Quote
...not the same as the truly gapless playback you get with actual CD's, tapes, or vinyl.


Or MPC, Ogg Vorbis, Monkey's Audio and FLAC formats.

Rob
Logged

johnc12

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • nothing more to say...
Re: Gapless Encoding & Playback
« Reply #16 on: July 09, 2003, 02:12:18 pm »

Quote

Or MPC, Ogg Vorbis, Monkey's Audio and FLAC formats.
Rob


Problem is, the chances of Apple supporting any of these formats on the iPod is zero.
Logged

loraan

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 320
Re: Gapless Encoding & Playback
« Reply #17 on: July 10, 2003, 08:31:35 am »

One thing you might try in MC is setting playback options to Fast Crossfade with 0.1 second overlap. I play back continuous albums this way and, although it's not truly gapless, even on the DJ albums (where tempo is important), I don't notice the tiny 0.1 second "skip" in the beat at the track boundaries. Or if I do, it's much less distracting than the silence between tracks.
Logged

gkerber

  • Guest
Re: Gapless Encoding & Playback
« Reply #18 on: July 10, 2003, 09:07:58 am »

Quote


It has already been proven that this is NOT an encoding issue, but rather a playback issue.  As already stated, other mp3 apps (like Winamp with the gapless plugin) and at least one portable mp3 player offer gapless playback with standard mp3 files.

Larry


Again, I am not an expert, but I have looked at the music waveforms in Goldwave at consecutive tracks which do not merge properly - not gapless.  These tracks DO clearly show short sections of silence at the start/end of the tracks, meaning they could not playback gapless, since the  mp3 file has silence in the data.  A comparable look at an APE file shows no such silence.

And the lame switches for gapless encoding, are encoding options (although it doesn't seem to work properly all the time).

I still think gapless playback is an encoding issue.
Logged

Sergio

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 87
Re: Gapless Encoding & Playback
« Reply #19 on: July 10, 2003, 11:34:37 am »

OK, here's the deal...

There are gapless-friendly and gapless-unfriendly file formats. Ogg and APE are friendly. MP3 is unfriendly.
What this means is that the MP3 format itself adds silence where it should not exist (something about end frames, I think).

Now, for gapless-friendly formats, it's pretty simple to solve, you just have to keep the playback buffer full, as someone said.
For gapless-unfriendly formats, it's trickier. You have to analyse the audio, detect silence (below a certain threshold) and eliminate it, to achieve gapless playback.

In MC, when you set playback to gapless, you get a solution that works for gapless-friendly formats. In order to get it working for gapless-unfriendly formats, you have to set another option, the silence removal one, which unfortunately also removes silence inside songs. I've asked JRiver to separate the two, but I guess they haven't seen it or haven't had time yet.

Now, this silence removal in MC is almost perfect, but there are some badly encoded MP3's out there that still don't get exactly gapless.

There is one other problem with gapless in MC. If you set the output format option on, silence removal seems to fail between files. At least it does when I change the sampling frequency to 48kHz...
Logged
Sérgio Gomes

johnc12

  • Regular Member
  • Recent member
  • *
  • Posts: 6
  • nothing more to say...
Re: Gapless Encoding & Playback
« Reply #20 on: July 11, 2003, 01:29:12 pm »

Its seems the best way then is not to encode using MP3.  But then I can't play back on the iPod.  I'm not sure how this will get resolved, as I don't think Apple will ever support OGG VORBIS or some other gapless format.  If I find another player that does, I would seriosuly consider dumping the iPod for it.  The iPod is great, but it would be even better if others could develop firmware for it!

Perhaps the MP3 standards people can come up with a newer MP3 format that plays gapless like some of the other encoding schemes.  Then the hardware vendors may actually support it.  Guess I'm stuck for now not being able to have truly gapless playback unless using the PC.  Bummer!!!!
Logged

rocketsauce

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1059
Re: Gapless Encoding & Playback
« Reply #21 on: July 11, 2003, 04:53:37 pm »

Quote
Guess I'm stuck for now not being able to have truly gapless playback unless using the PC.


Well, the solution for gapless playback on your iPod is to rip the entire album as a single MP3. The drawback is that you won't be able to skip thru the tracks.

Rob
Logged

kiwi

  • Citizen of the Universe
  • *****
  • Posts: 817
  • Don't worry, be happy...
Re: Gapless Encoding & Playback
« Reply #22 on: July 12, 2003, 04:43:26 am »

Quote
Its seems the best way then is not to encode using MP3.  But then I can't play back on the iPod


Do MP4's have the same problem with gaps?  iPods can play those.
Logged

rocketsauce

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1059
Re: Gapless Encoding & Playback
« Reply #23 on: July 12, 2003, 10:12:51 am »

Yes, I believe that AAC/MP4 is also gapless un-friendly.

Rob
Logged
Pages: [1]   Go Up