Converting Monkey’s Audio (ape) to flac in Ubuntu
Converting .ape files to the flac format in linux requires both the “mac” and “flac” software packages. For details on installing mac in ubuntu see here. To install flac enter the following in a terminal window:
sudo apt-get install flac
Audio file format conversions can be performed from the command line, or via the GUI using soundKonverter.
If you prefer to work from the command line, then you will want to install shntool:
sudo apt-get install shntool
Shntool functions as a frontend of sorts for lossless audio software (mac, flac, wavpack). It performs a range of functions including facilitating the conversion of music files between the various lossless formats (ape, flac, wv, wav, etc). Note that shntool has native support for .wav files only; if you want it to work with .ape, .flac or .wv files then you must have the appropriate helper programs (mac, flac, wavpack respectively) installed. For a full list of the lossless formats supported by shntool type “shntool -f”. To convert all .ape files in a directory to flac using shntool:
shntool conv -o flac *.ape
This command can also be given as:
shnconv -o flac *.ape
An alternative to using shntool is to work via the mac and flac programs directly; to convert a monkey’s audio file to flac:
mac sample.ape sample.wav -d
flac -o sample.flac sample.wav
It is possible to pipe the output of mac directly into the flac tool - you would get equivalent results by issuing:
mac sample.ape - -d | flac -o sample.flac -
To convert a directory of ape files to flac:
for i in *.ape; do mac “$i” - -d | flac -o “${i%*.ape}.flac” -; done
(Note: if you are copying the above command and it pasting into the terminal window, you will need to replace the “curly quotes” used by WordPress with the straight/ non-curly quotation marks used by the shell.)
You could put the above line in a bash script to simplifiy the conversion process.
SoundKonverter - Audio file format converter
SoundKonvertor is a GUI frontend to programs such as mac and flac. It allows you to convert your music files between the various formats using a point and click interface. This is an excellent option if you find working with the command line to be tedious. Note that SoundKonverter requires mac and flac to be installed to be able to work with monkey’s audio and flac formats respectively. To install soundKonverter:
sudo aptitude install soundkonverter
soundKonverter can be launched by selecting the appropriate icon from your applications menu (in KDE it is installed under the Multimedia menu).
Preserving ape tags
Unfortunately shntool and soundKonverter do not preserve existing tag information (album, artist, genre, etc.) when converting monkey’s audio files to flac or other lossless formats.
Jared Breeland has written a nice bash script (convtoflac.sh) which will convert your monkey’s audio files to flac preserving your precious tag information in the process. The convtoflac.sh script was written on a Gentoo system but with a very slight amount of tweaking it will work on your Ubuntu/ Kubuntu system. Note: the script calls on a small program (apeinfo) to extract tag information information from the ape files which is then transferred to your converted files. Jared provides a binary (compiled) version of apeinfo and the source code. The binary was compiled on a Gentoo Linux system (running GCC 3.4.4 and glibc 2.3.5) - it works fine on my Ubuntu and Kubuntu 7.04 installations. Instructions for Ubuntu/ Kubuntu users: If you don’t already have one, create a directory called “bin” in your home directory, and download and place the convtoflac.sh script and the apeinfo binary file there. Open the convtoflac.sh script in a text editor and make these two small changes to the script: 1) look for the line containing “SED=/usr/bin/sed” and change it to “SED=/bin/sed” (this is needed because the sed binary - a text processing program - is located differently in Ubuntu than Gentoo). 2) Look for the line containing “APEINFO=/usr/local/bin/apeinfo” and change it to “APEINFO=~/bin/apeinfo”. You also need to ensure that the script and also the apeinfo binary have their execute bit set (this allows them to be run):
chmod a+x ~/bin/convtoflac.sh
chmod a+x ~/bin/apeinfo
To convert an ape file to flac using the convtoflac.sh script enter the following in a terminal window:
convtoflac.sh sample.ape
To convert an entire directory of ape files to flac:
for i in *.ape; do convtoflac.sh “$i”; done
(Note: if you are copying the above command and it pasting into the terminal window, you will need to replace the “curly quotes” used by WordPress with the straight/ non-curly quotation marks used by the shell.)
Source: http://aidanjm.wordpress.com/2007/02/04/converting-monkey%E2%80%99s-audio-ape-files-to-flac-in-ubuntu/

Комментариев нет:
Отправить комментарий