Of course, if you have FLAC files, it doesn't mean you could enjoy a crispy bright playback of an audio CD. There are several more factors, they are, your sound card, your amplifiers and speakers. As for me, with only on board sound card and a Sony Ericsson standard Walkman phone headset, it's meaningless to play FLAC tracks on my laptop. It just a waste of precious harddisk space. But nonetheless, I still spare them for keepsake, in case someday I could afford a better audio system.
So, the solution for a time being is to burn my FLAC collections onto DVDs, then ripping them into OGG format. This tutorial on Archlinux Wiki provides the basic script, I made some slight modification to it so that the final result would be OGG instead of MP3. This script will work on any UNIX system with bash shell on it (including Cygwin).
First, you need to provide all the dependencies. You will need these binaries (refer to your distro guide on how to install them).
flac oggenc
Then, copy the following script to your text editor, save it as anything you feel like (the convention is not to give any extension to the filename, as this is an executable , and normally executables don't have any extension). In this example, I save it as flac2ogg.
#!/bin/bashfor a in *.flacdoOUTF=`echo "$a" | sed s/\.flac$/.ogg/g`ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`ALBUM=`metaflac "$a" --show-tag=ALBUM | sed s/.*=//g`GENRE=`metaflac "$a" --show-tag=GENRE | sed s/.*=//g`TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`DATE=`metaflac "$a" --show-tag=DATE | sed s/.*=//g`echo "$a"flac -c -d "$a" | oggenc -q 8 -a "$ARTIST" -G "$GENRE" -t "$TITLE" -d "$DATE" -n "$TRACKNUMBER" -l "$ALBUM" - -o "$OUTF"done
The next step, as a superuser, make it executable.
$ sudo chmod 0775 flac2ogg
Still as a superuser, copy it to the local binary directory, /usr/local/bin.
$ sudo cp flac2ogg /usr/local/bin
The final step, as a normal user, add /usr/local/bin into PATH environment variable. To make it handy, we will need to modify the .bashrc file so that/usr/local/bin is always in PATH every time you log in. Now you can call the script from anywhere.
$ export PATH=$PATH:/usr/local/bin
Add the same line above to your .bashrc.
Now you can manually remove the unused FLAC files.
rm -v *.flac
Adding this line will get your script to automatically remove the original FLAC right after it has been encoded to OGG. Put it before the very last line (before done).
...rm -v "$a"done
PS:
The blogger editor fails so hard, either in HTML or WYSIWYG mode. Srsly, they need to fix it up. It always complains errors when I add images, and it also messing up the 'quote' command. I wonder why they always said blogger is better than wordpress.
Edit:
PHAIL. It cannot change the font into fixed-width font (Courier). blogger.com sucks.
No comments:
Post a Comment