netbook network mp3 player

By Hal Canary, 2009-09-16 15:37:59 (link)

I wanted to access my desktop's music library from my living room and play it through the amplifier and speakers there. So I grabbed my netbook, and after fumbling around with NFS for too long, I just tried:

yum install sshfs

(It's a OLPC XO-1, so it's Redhat-based.) And then wrote a little script:

## ~/bin/mount-music
mkdir -p "${HOME}/music"
sshfs hal@sloop:/d/music "${HOME}/music"

I installed mpg123-alsa (by the simple expedient of copying the executable) and wrote a little script to run it.

test -f "${HOME}/music/index.txt" || \
    sshfs hal@sloop:/d/music "${HOME}/music"
cd "${HOME}/music"
exec mpg123-alsa --control --long-tag \
    --shuffle --list index.txt

And index.txt is a file created with the find command on the server:

# run this script to refresh the index file.
cd $HOME/music
find . -type f -a -name '*.mp3' > index.txt