Skip to content

Instantly share code, notes, and snippets.

@ixxra
Created February 17, 2014 03:33
Show Gist options
  • Select an option

  • Save ixxra/9044268 to your computer and use it in GitHub Desktop.

Select an option

Save ixxra/9044268 to your computer and use it in GitHub Desktop.
rip.sh - Rip a cd into flac files. It uses cd-info and gstreamer 1.0
#!/bin/bash
#
#rip.sh
#
#Rip a cd into flac files.
#
#It uses cd-info and gstreamer 1.0
#
trackname()
{
printf "%02d" $1
}
cd-info --no-device-info --no-disc-mode -I > disc.info
total_tracks=$( sed -n 's/CD-ROM Track List (1 - \([0-9]\+\))/\1/p' disc.info )
echo "total tracks: " $total_tracks
for i in $( seq 1 ${total_tracks} ); do
gst-launch-1.0 cdda://${i} ! flacenc ! filesink location=track$( trackname ${i} ).flac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment