PDA

View Full Version : Gapless playback



wolfman
07-26-2004, 06:12 AM
Absolute gap less playback of mp3 live tracks (or tracks that where crossfaded on the original CD) obviously still is a problem. I think I tried all there is so far. I use the Blade decoder for conversion. This makes sure that the mp3 file itself has no gap at the beginning and at the end. If you put two tracks back together again in a good digital audio editing program like Wavelab, the tracks play back to back absolutely without any gaps. So technically this problem should be manageable.
I tried to use two windows media players within a VB program, where the second player start as soon as the first track has ended - it gets pretty close but far from being perfect. The results are pretty much the same as in the dbPowerAmp Music Player. Again - good but not perfect.
I do not know enough about mp3 files to realize where the actual problem lies.
Has anybody any ideas on that subject?

Unregistered
08-10-2004, 10:00 PM
an old hack i've been using for ages is the DOS command

COPY TRACK1.mp3 + TRACK2.mp3 + TRACK3.mp3 ALBUM.mp3

but really, the solution lies in the playback. it seems simple enough that you want to keep the audio output buffer full - assuming you can tell the difference between silence in the file and a 'gap' caused by decoding delays.

chris goussey
08-11-2004, 11:05 PM
I'm also looking for a solution for the same problem

the problem isn't the mp3 format: the playback will never be perfect when there is a jump between different files, so the problem will occur in every format and player that is used. The solution: use the same principle as streaming audio. The principle: just fill the buffer of the player by yourself - it means that you give the audio data to the player instead of the player gets its data from a file.
I want to let the beast work in VB. Objects like windows media player that can be easily inserted in vb cannot be used.
So - let me try, i hope to find an easy solution, if anyone can help with relevant information - just post please

(- sorry if my english sucks

wolfman
08-12-2004, 08:05 AM
The streaming idea makes a lot of sense to me. If you could make the a player like wmp "think" that it is getting an audio stream over the internet, we should be there. At least theoretically, because I don't know anything about audio quality issues realated to audio streaming.
The other idea would be that you start playing the first track and shortly before it ends append the next track to it "on the fly". That would have the same effect as if you would play a file that is being downloaded over the internet. I tried it with the wmp and it seems to work fine. It has no problem playing mp3 files that are being downloaded (=incomplet mp3 files) up to the point where the download file ends. When new frames are downloada and appended, it plays the new ones until it reaches the end again.
So the idea would be to create a temp file that is being appended track by track as long as you keep on playling your playlist. So you would not play the "original" mp3 files, instead you play a temp file that is getting bigger and bigger as long as you leave the playlist playing.

Any other ideas?

Unregistered
08-13-2004, 01:27 AM
What you've said about play the second song a little bit before the first one ends : i think the gapless option in dbpoweramp works this way (you can set the number of ms perfect by recording (with cool edit 2000 or something) the soundcardoutput while dbpoweramp plays, then check how long the gap exactly is)
Your idea of the preview-playback of mp3 while downloading is really good, but the problem is that the player can't display the current position in tracks anymore
however - i want a gapless player integrated in my self-made music database (visual basic) and for the moment i'm checking some source code of other players in vb (it's really hard - spoon must be a genius)

ChristinaS
08-13-2004, 01:56 AM
I don't know if this would help you.

You can set up an asx meta file for your playlist. This will perform pseudo-streaming.

Using Notepad, create a file with the extension .asx, let's call it mystream.asx

Put in it an entry for each mp3 file you want to play, in the sequence you like, respecting the format given below:



<ASX VERSION="3.0">

<ENTRY><REF HREF="xyz.mp3" /></ENTRY>
<ENTRY><REF HREF="abc.mp3" /></ENTRY>
...
...
</ASX>


There are other tags that can be used, like <author>, <title>, etc, but not important at this point.

When you want to play your playlist, you play the file mystream.asx in Windows Media Player. You can adjust the buffer size there.

I still don't know if it can do it seemlessly though.

wolfman
08-13-2004, 03:50 AM
The .asx version looks like another good idea. I just don't know how to adjust the buffer size in wmp. But whatever you do, you should not forget to use the Blade decoder for your mp3 conversion. As far as I know this is the only decoder that does not leave even a ms of silence at the beginning and at the end of the mp3 file. The Lame decoder does that.

ChristinaS
08-13-2004, 10:17 AM
The buffer size in WMP is generally tailored to streaming off the web and WMP detects the connection. The faster the connection, the smaller the buffer need be.

But you can set that buffer to anything you like. Try 20s and see how that works, that's usually a good value for dial-up connections, it surely will work well offline as well.


To change the buffering time in WMP:
- On the Tools menu, click Options.
- Click the Performance tab.
- Click Buffer <seconds> seconds of content, and then type a number between one and 60.
Note : Content is buffered before playing

chris goussey
08-17-2004, 07:08 PM
there are players that support gapless playback using a pre-track buffer, wich works better then playing the next song a bit earlier.

- winamp: click Options > Preferences > Choose Plug-ins - output, click on wavOut output > Configure : now set the value of the slicer "Buffer ahead on track chance" to a value above 400 ms

- vuplayer www.vuplayer.com

O, don't forget players use another decoder then Blade - maybe they add a silence?

Another question:
Is dbPowerAmp the only player that easily can be directed from Visual Basic?

wolfman
08-18-2004, 03:36 AM
DbPoweramp is not the only one. I use Windows Media Player. I have written my own database program on VB using the MySql platform. Then I added wmp to it to play the archived music. If you download the respective SDK from Microsoft, you get all the necessary commands for wmp. The big advantage using wmp was that I can have more than one instance of the player running. A feature that I use for customizing crossfading or simply playing a tracklist on one player and doing previews on the other. Other than that,I don't like it too much.
There is an open source player out ther called foobar2000. I came across it recently, but have not explored it in detail yet. But it looks very promising.