Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Issues Getting Gapless Playback to Work (Read 1325 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Issues Getting Gapless Playback to Work

Hello,

I have been having issues with gapless playback and it not functioning correctly. The main issue I am experiencing is a noticeable transition between songs, a minor gap of about 0.5s. This causes the songs to not transition seamlessly and reduces the quality of the listening experience.

I have searched all over Reddit and the forums for solutions to this problem but have found none that have worked for me. I have tried altering the buffer length under File -> Preferences -> Playback -> Output modifying the buffer length itself to be the smallest value possible (50ms) and also manually enabling the Fading setting on this screen and trying a variety of different fade variables. As low as 50ms to values between 300-1000ms and have still noticed the same gaps occurring in playback.

I have also tried enabling the Crossfader DSP under File -> Preferences -> Playback -> DSP Manager and experimenting with a variety of different fade durations. However it seems that no matter what duration I set it causes a noticeable skip if too low, or the sound of each track to overlap over each other with a mismatched tempo if set too high.

I have also tried installing several components to try and resolve the issue but none seemed to fix the issue. I have also tried uninstalling and reinstalling the program entirely, and also using the latest preview version of the program. Nothing has resolved this issue.

To provide some additional detail on the specific tracks I am listening to, the file format is .m4a, sample rate 44100 Hz, Codec AAC, Encoding is lossy, Tool is Lavf58.20.100. I'm not sure how much this information is relevant as I'm not too proficient with this program or complex audio formats so I just wish to provide as much information as needed to diagnose and resolve the problem.

If any further information is needed to resolve this issue simply reply with what you would like to know and I will do my best to provide the information as soon as possible. Any help whatsoever would be greatly appreciated, thanks!

Re: Issues Getting Gapless Playback to Work

Reply #1
Perhaps you have some misconception what gapless playback mentioned in the feature list means. It means source tracks are played in their entirety without removing anything or adding anything extra (like gaps) into them. Back when foobar2000 was created a common behavior with audio players of the era was to close audio device between tracks and open it again causing significant delays between track changes.

If you knew all that and your files are supposed to flow together seamlessly, the gap can only be caused by some fault in the files. Perhaps the program used to encode them failed to write the accurate length information in a format supported by foobar2000.

If your files are encoded correctly, and they are supposed to have silence between them (as is the case with majority of albums) but you want to get rid of the silence, you will need to use DSPs to alter the behavior to your liking.

I'll attach two test AAC files here so you can confirm that gapless playback works perfectly out-of-the-box.

Re: Issues Getting Gapless Playback to Work

Reply #2
I understand. So it seems as though the issue is with the files themselves, as the files you have provided flowed into one another  seamlessly. In this case, would I be able to manually alter the length information of the files through foobar2000? Or would the best solution simply be to download a different set of files, ones that are hopefully without error.

As, to restate what I'm experiencing once again. The transition between certain songs does not line up perfectly. I believe that silence is not supposed to be there, however it seems there is a very small amount of silence between the two songs which is likely what is causing the abrupt jump between songs that occurs when listening to the songs transition from one to the other.



MOD edit: Direct reply. Removed unnecessary full quoted text.

Re: Issues Getting Gapless Playback to Work

Reply #3
CD audio content is one long track, just like an LP or a cassette.  There is additional non-audio data embedded on the CD which provides cue information for CD players, so that if the user selects (say) track 6, the player looks up the cue point for track 6 and starts playing there.

When you (or somebody else) rips a CD, the only knowledge a ripper has of where each individual track starts and ends is the cue data, which declares the start of each track (sometimes incorrectly) not the end.  The ripper extracts the whole audio data and then splits it at the cue points to make individual tracks... but the consequence is that each ripped track includes any silence between tracks.

If you want your tracks to play with no silence in between, you need to edit out the silence (preferably in the WAV rip before the track is then compressed into MP3 or whatever).

I have also known the start of a track to be in the end of the previous track, because the cue point stated was in the wrong place.  This might be a deliberate ploy to make rips imperfect, but so long as I spot it I can simply edit the tracks together and split them at the right place.

I believe there is a FB2K add-on to skip silences without editing them out, but somebody else will have to advise on that.

Abrupt jumps between tracks are going to be a possibility if the tracks are cut too close to non-silence.  To avoid the abruptness, tracks need to be cross-faded rather than "switched".
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Issues Getting Gapless Playback to Work

Reply #4
The "libav" in the tool string refers to ffmpeg being used to encode the files. I should probably have tested this before but I just tested now and even current ffmpeg doesn't manage to create gapless AAC files at least in MP4 container. In theory it should be possible to edit the gapless playback information but I'm not aware of tools to allow losslessly changing this metadata. foobar2000 allows editing similar information in MP3s.

Perhaps it would be best to acquire the files in proper lossless format so you can encode them yourself correctly. As amazing as FFmpeg is it's not the best tool for accurate audio encoding.

Re: Issues Getting Gapless Playback to Work

Reply #5
Got it, so it has something to do with the file's format and encoding causing it to have issues with playback. Sorry to keep restating myself, but I'm not too knowledgeable in the audio space. What lossless file formats would be best to help prevent this from happening? And furthermore, how would I encode the files myself? I really appreciate the help in this thread, I am already learning a lot.

Re: Issues Getting Gapless Playback to Work

Reply #6
Any lossless format would do. Lossless means that it's perfect copy of the original source file. FLAC is the most widely used lossless format and also used by several online audio stores.

If you don't aim for lowest bitrates, you should get the highest quality AAC encodes with Apple's encoder. It's easiest to use with qaac frontend, and with foobar2000 that's easiest to use by installing the Free Encoder Pack. The qaac frontend doesn't work alone, it needs Apple's dlls. If you install iTunes from Microsoft Store before installing the Free Encoder Pack, the installer can copy the necessary dlls for you.

Re: Issues Getting Gapless Playback to Work

Reply #7
I see, this has been very helpful. I've went ahead and downloaded a lossless version of the album and surely enough the transition between songs is now seamless. I also appreciate the further recommendation for file and encoding formats. Thank you so much!