Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Linux: APE tag reader and FLAC conversion script (Read 8326 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Linux: APE tag reader and FLAC conversion script

This post will likely only be of interest to Linux users, but it should be a big help to those who use Linux and have to work with APE files.  I've written a couple programs to help manage APE files under Linux.

The first apeinfo, which is a C++ program that returns a detailed list of information about a given APE file.  It's largely based on a sample program included with the Linux MAC port, and relies on MACLib provided by the same package (Monkey's Audio Codec non-win32 ports, by Matthew T. Ashland).  Running it on an APE file in its default mode will yield output like the following:

Code: [Select]
$ apeinfo ~/ape/bitch.ape

File Information
     File Name: bitch.ape
     File Size: 30232 kb
   APE Version: 3.99
   Compression: Normal
    Tag Format: APEv2

Audio Information
   Track Length: 4:12.760 (252 s)
    Samples/sec: 44100 Hz
    Bits/sample: 16
       Channels: 2
     Peak level: -1

Tag Information
     Album: Blurring The Edges
    Artist: Meredith Brooks
   Comment: Exact Audio Copy
     Genre: Rock
     Title: Bitch
     Track: 2
      Year: 1997

It can also be run with the -t option, which outputs the tags in VORBISCOMMENT format:

Code: [Select]
$ apeinfo -t ~/ape/bitch.ape
ALBUM=Blurring The Edges
ARTIST=Meredith Brooks
DESCRIPTION=Exact Audio Copy
GENRE=Rock
TITLE=Bitch
TRACKNUMBER=02
DATE=1997

The second program is shell script that transcodes an APE file to a FLAC file.  It uses the VORBISCOMMENT output from apeinfo to migrate tag information as well.

The reason I wrote these programs is because prefer the FLAC format, but occasionally have to work with APE files instead.  So, I wanted an easy way to transcode the APE files FLAC files.  Decoding with mac and then reencoding with flac is easy enough to do, but as far as I can tell there is no readily available program that can read APE tag information from the Linux command line.  So, I fixed that problem. 

For anyone interested in trying it out, full details and download links can be found on the application website at http://www.legroom.net/mysoft.  Any and all feedback is welcome.  Hope you find it useful.

Linux: APE tag reader and FLAC conversion script

Reply #1
The reason I wrote these programs is because prefer the FLAC format, but occasionally have to work with APE files instead.  So, I wanted an easy way to transcode the APE files FLAC files.  Decoding with mac and then reencoding with flac is easy enough to do, but as far as I can tell there is no readily available program that can read APE tag information from the Linux command line.  So, I fixed that problem. 


You’d be a hero if you could make it convert APE plus cuesheet to single FLACs while conserving the tags. I know about shntool but using it is always a longish procedure.

Linux: APE tag reader and FLAC conversion script

Reply #2
You’d be a hero if you could make it convert APE plus cuesheet to single FLACs while conserving the tags. I know about shntool but using it is always a longish procedure.

Hmm... I wouldn't really mind trying my hand at it to see if it could be done, but I don't even know exactly what it is you're describing.  Starting with an audio CD, how do I create the kind of "APE plus cuesheet" that you want to convert?

Linux: APE tag reader and FLAC conversion script

Reply #3
You’d be a hero if you could make it convert APE plus cuesheet to single FLACs while conserving the tags. I know about shntool but using it is always a longish procedure.

Hmm... I wouldn't really mind trying my hand at it to see if it could be done, but I don't even know exactly what it is you're describing.  Starting with an audio CD, how do I create the kind of "APE plus cuesheet" that you want to convert?


In former times I was a proponent of CD Images with cue sheets. I’ve moved to Linux and Quod Libet now and need to cut all that into pieces. I have a VMWare machine with foobar running but accessing my big disk via samba always results in "lost write" errors.

These images are usually generated by EAC with the Copy Disc (or whatever != single tracks) mode.

Linux: APE tag reader and FLAC conversion script

Reply #4
foobar2000 works fine (for conversion, tagging etc, not playing) under wine w/o any tunings. Why use vmware? Just put flac.exe (or lame.exe, oggenc.exe, wavpack.exe etc.) to "~/.wine/drive_c/program files/foobar2000" directory after installation of fb2k.

Linux: APE tag reader and FLAC conversion script

Reply #5
foobar2000 works fine (for conversion, tagging etc, not playing) under wine w/o any tunings. Why use vmware? Just put flac.exe (or lame.exe, oggenc.exe, wavpack.exe etc.) to "~/.wine/drive_c/program files/foobar2000" directory after installation of fb2k.


In needed the Windows install for other tools anyway so installing Wine seemed redundant.

Linux: APE tag reader and FLAC conversion script

Reply #6
XP within VMWare actually works fine on my server. I use foobar2000 for tagging/replaygain/conversion to single file flac etc. The only problem was slow networking speed which I fixed using this on the host Linux box:

ethtool -K eth0 tso off

It's a real pity I have to use it though as the Linux tools available just don't seem 'joined up' enough for my needs.

I did strip my XP install CD to a ~130mb ISO file, removing all the crud I don't need for foobar. This lets the VM run in 192mb of memory just fine.