Posted By

deepsoul on 08/15/09


Tagged

mplayer playback gapless


Versions (?)

Gapless playback for mplayer (Linux)


 / Published in: Bash
 

mplayer (or its GUI cousin, gmplayer) does not natively support gapless playback, which is what you want when playing sources which have songs crossing track boundaries (classical and some modern music). In my experience the buffering Linux provides for named pipes is sufficient to bridge the gaps.

So the idea is to make mplayer output PCM data to a named pipe and use aplay to play the result. The sample rate and format have to be known, because we have to disable wav headers which otherwise cause clicks. There is a noticeable delay if you try to use the controls to skip forward or backward.

  1. mkfifo aufifo
  2. aplay -t raw -c 2 -f S16_LE -r 44100 aufifo &> /tmp/aplayfifo.log &
  3. gmplayer -ao pcm:nowaveheader:file=aufifo track01.ogg track02.ogg track03.ogg &

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: benow on January 3, 2010

Good stuff, thx. I've integrated this with my random album play script, if interested.

You need to login to post a comment.