====== Introduction ====== Gapless playback is the process of getting playback of consecutive media to appear as if it is one big stream. Gapless playback is also sometimes referred to as seamless playback. Normally the biggest fuss about this is when talking about the MP3 format, because it does not support this in it's original specification. (See below for technical information of why.) There has been developed a few solutions to this though and this page will explain how to get QMP to playback files without getting gaps. ===== Gapless playback in QMP ===== To get good gapless playback both the input and output plug-in in QMP needs to support it. The QMP MP3 plug-in has support for this, if the MP3 file is encoded with a recent [[wp>LAME]] encoder. To get it to work properly the output plug-in needs to be configured as well. ==== WaveOut ==== To enable gapless playback when using the [[Waveout plug-in]] open the configuration window for the plug-in. Enable the "Seamless playback" option. {{waveout_preferences.png|WaveOut output plug-in configuration window}} ==== Crossfading DirectSound ==== If you are using the [[Crossfading DirectSound plug-in]] there are a few more options to play with. Open the configuration window for the plug-in and select the "Gap remove" tab.\\ Enable the "Seamless playback" checkbox to get functionality equal to the waveout plug-in. If you want a bit more compatibility with MP3 files not encoded with a recent [[wp>LAME]] encoder enable the "Remove leading and trailing silence" checkbox.\\ The "Silence threshold" slider controls what QMP should consider as silence and in effect when it will cut of the current song and move to the next. (Only when playback is near the end of the song though) Play a bit with this setting on your favorite seamless recordings to get a good result. {{crossfader_settings_gap_removal.png|Crossfading DirectSound configuration}} ===== Technical information ===== MP3 data is broken into 'frames'. Each frame of audio data is always 1,152 samples long. So if the number of samples in the song you're trying to record isn't perfectly divisible by 1,152 you get silence padded to the end to make up the difference. Now, there's various ways that a player can try to remove that padding when you play the file, but that's not part of the official standard. LAME writes a tag to the file (a Xing VBR header, to be exact) that specifies how many samples were padded to the track. The player can read that header and know exactly how many samples it needs to remove from the end to get the correct original length of the track. QMP added support for this a while back. The biggest problem with this method is that if the file wasn't encoded with LAME, it won't work. The other method is for the player to look for silence at the end of the audio data and 'guess' where the end is actually supposed to be. QMP supports this in a general way with the [[Crossfading DirectSound plug-in]]. This isn't perfect in all cases though and in it will (probably) fail in some cases no matter what settings are used. There is one other thing that can cause gaps in playback. Some players close the playback stream with Windows at the end of one track, then open another one for the next track. Most modern players can just send it all to Windows as one continuous stream, though. ===== Links ===== For more information about gapless playback in QMP, read this:\\ [[http://www.quinnware.com/forum/showthread.php?t=4016|Yet another gapless playback thread, and a long one at that!]] \\ (The information is quite old though and some parts have changed) For general information of gapless playback see: \\ [[wp>Gapless_playback|Gapless playback @ Wikipedia]]