Technical stuff, mostly to remind myself when I forget in a couple of months' time.

Friday, 31 May 2013

Copying music files

My music files are stored on a server; sometimes I want to copy a selection onto sn SD card for playing in the car. The steps are:

  1. Make a playlist on the Squeezebox.
  2. Grab the playlist m3u file.
  3. Remove all the lines that start with the # character: sed '/#/d' playlist.m3u > music.txt
  4. Mount the Samba music share on my server: sudo mount -t cifs -o username=me //192.168.1.2/music /media/music
  5. Do a search and replace in a text editor on the text file so that the paths all reference /media/music
  6. Copy the files: first set IFS to a new line, then: for file in $(<music.txt); do cp -v "$file" music/; done
Then I run the files through Sound Converter because the player in my car can only deal with mp3 files.

Your Host

Husband, father, pop music anorak, guitarist