FU Audio Tool

.. or just fat.

Excerpt from README:

Fat is a command line tool which enables tagging and renaming of audio files. It was originially written a few years ago to scratch a personal itch. It is quite powerful in its features, supporting both tag value extraction from file name patterns, as well as renaming based on tag values. It can operate recursively on entire directory trees of audio files. Fat also has something called transfer profiles, which means that you can transcode a set of audio files to a given destination (currently only to MP3 format), with all tag values preserved of course. Fat takes care of naming the files properly, according to a given template. You could easily create a pure “MP3 mirror” of your entire mp3/flac/ogg audio file collection with a single fat command invocation. Parallel encoding is supported to better take advantage of multiple CPU cores when transcoding a large set of audio files to MP3.

Summary of features:

  • Read and write supported tag fields of MP3, Flac and Ogg/Vorbis audio files transparently.
  • Set cover images on audio files directly from URL off the web.
  • Rename audio files based on tag values and templates. Can operate recursively.
  • Infer and set tag values based on file name regular expressions.
  • Strip tags completely from files, or delete just selected fields from tags.
  • Transcode supported file formats to MP3, copying/preserving all tag data from the original files and naming the files according to a template.

Summary of anti-features:

  • It’s rather slow due to its shell script nature, and it’s big as well. Emphasis was put on correctness, compatibility and feature set rather than raw speed.
  • Only some of the most common tag fields are supported, because that was all I needed myself. Adding support for other fields is possible, but a fair amount of work for support in the file format backends.
    Currently supported fields:
    artist, albumartist, album, title, track number, total tracks, disc number, year, genre, comment, front cover image, “other” image

Get it here: fat-2.4.1.tgz, version 2.4.1, 2013-01-04 [PGP signature: fat-2.4.1.tgz.asc]
The archive bundles version 0.6.18 of the EyeD3 Python MP3/ID3 tagging library.

Changelog

Version 2.4.1:

  • Numerous improvements and bugfixes.
  • Added support for ALBUMARTIST field for MP3, FLAC and Ogg/Vorbis.

Version 2.3:

  • Various improvements and bugfixes accumulated over time.
  • New version of bundled ID3 library.

Installation

Basically it requires no installation, other than unpacking the tar archive and adding the directory to your PATH. You will however need to install the runtime dependences, if you haven’t already. See README file and ‘fat -h’ for documentation.

Fat has not been tested on anything but Linux, so your mileage may vary. There are probably bugs, but I have used this tool regularly, ever since I wrote it a few years ago, on my own music collections. However, the regular GPL disclaimer applies, I take no responsibility for your data loss when using this tool. I do respond to bug reports, though :).

Usage examples

$ fat *

Show tag values for all files in the current directory. Of course, fat will only
be able to extract tag values from audio files of the supported types.

$ fat -a "The Artist" -b "An album" *.mp3

This will tag all MP3 files in the current directory with the values for artist
and album (set mode). Fat tries to use the most compatible ID3 version
combinations whenever MP3 files are tagged.

$ fat -a "The Artist" -b "An album" *.ogg

This will tag all Ogg files in the current directory with the values. Exactly
the same as the previous example.

$ fat -N --template '${ARTIST} - ${TITLE}' *.mp3 *.ogg *.flac

Rename all MP3, Ogg and Flac files in the current directory according to the
given template, based on values of tags in the files. Use 'fat -N' to show
available pre-defined templates.

$ fat -X0 --dest /media/MP3DISK -R /path/to/music

Transfer/transcode all supported audio files found recursively under
'/path/to/music' to destination '/media/MP3DISK', encode to MP3 and name files
in a suitable hierarchy based on tag data. This will encode in parallel if you
have multiple CPU cores available. Use 'fat -X' to show available transfer
profiles.

You can add more transfer profiles or naming templates (and tweak the existing
ones) by editing the top parts of the 'fat' script itself.

Manual

$ fat -h
FU Audio Tool v2.4.1

Use: fat [options] file1 file2 ..
If called without options, then tag fields will be shown for each file.

Major modes of operation:
. Get tags from files (the default, no options required)
. Set tag values on files (use the various set options)
. Delete tag values from files (use --del)
. Completely strip all tags from files (use --strip)
. Touch file tags (load and re-write tags, but don't change any contents).
. Rename files and directories using a template (use --rename, see options) based on tag values
. Transfer/copy audio files to a given medium or location (use --xfer, see options)

You cannot combine multiple major operation modes in a single invocation.

Supported file formats: MP3, FLAC and Ogg/Vorbis.

Available options: 
  -a VALUE                         Set artist (string).
  --artist VALUE                 
  -A VALUE                         Set album artist (string).
  --aa VALUE                     
  --albumartist VALUE            
  -b VALUE                         Set album (string).
  --album VALUE                  
  -t VALUE                         Set title (string).
  --title VALUE                  
  -n VALUE                         Set track number (integer).
  --tn VALUE                     
  --tracknumber VALUE            
  -x VALUE                         Set track total (integer).
  --tt VALUE                     
  --tracktotal VALUE             
  -m VALUE                         Set disc number (integer).
  --dn VALUE                     
  --discnumber VALUE             
  -y VALUE                         Set year/date (e.g. 1999).
  --year VALUE                   
  --date VALUE                   
  -g VALUE                         Set genre (string).
  --genre VALUE                  
  -c VALUE                         Set comment (string).
  --comment VALUE                
  --image-cover VALUE              Set front cover image (path to image).
  --image-front VALUE            
  --image-other VALUE              Set image (path to image). 

  --extract-images                 Extract embedded images to temporary files
                                   when getting tag values. This is disabled by default. 

  --set-from-regexp VALUE          Set tag fields based on regular expression on the filename.
                                   Example of the format for this parameter:
                                      --set-from-regexp '/^(\w+) - (\w+)$/   title, artist'
                                   Groups in the regular expression must correspond to
                                   the list of fields given afterwords. File extension
                                   should *not* be considered in the matching pattern.
                                   The regular expression uses Perl syntax.
                                   Note that field values specified with an explicit set-parameter
                                   will override values derived from this option. 

  -D VAL1 -D VAL2 ...              Delete tag fields from file(s).
                                   The value may be a comma or space-separated list of fields
                                   or you can specify -D multiple times.
                                   Valid fields: artist, albumartist, album, title, tn, tt, dn,
                                                 date, genre, comment, image_cover, image_other,
                                                 help (show this list)
  --delete VAL1 --delete VAL2 ...   

  -S                               Strip all tag data from file(s) USE WITH CAUTION !
  --strip                           

  -T                               Touch tags in audio files.
                                   This will load and re-write file tags without changing any values.
  --touch                           

  --super-touch                    Load tag values, completely strip all tags from file and re-write new tags
                                   without changing any values. Useful for fixing corrupted ID3 tags, etc.
                                   WARNING: This will remove all fields that fat does not support !
                                   USE WITH CAUTION ! 

  -N                               Rename audio files based on embedded tag values.
  --rename                       
  --rename-dry-run                 Don't actually rename files, just show the generated names.
  --purge                          Purge "empty" directory trees consisting only of directories after a rename operation. 

  --template VALUE                 Use a pre-defined or custom template when renaming or transfering (provide id or a value).
  --templates                      List pre-defined template-values (ids and values). 

  -X VALUE                         Transfer/transcode audio files using the given transfer-profile id.
  --xfer VALUE                   
  --xfers                          List available transfer profiles. 

  --xfer-write-filelist VALUE      Writes all destination files in a transfer to given file, one per line.
  --dest VALUE                     Set destination root directory for rename or transfer. 

  --overwrite                      Overwrite existing destination files (in transfer or rename mode).
  --overwrite-if-older             Overwrite existing destination file only if it is older than the source file (in transfer or rename mode). 

  --list VALUE                     Read list of input files/dirs to operate on from a playlist file.
                                   Supported playlist formats: .m3u, .pls, plain text (one entry per line) 

  -R                               Recurse into directories when processing files.
  --recurse                         

  --id3 VALUE                      Set ID3 tag version to use for MP3 files.
                                   Specify without VALUE to get list of supported versions.
  --id3enc VALUE                   Set preferred ID3 encoding for tagging MP3 files.
                                   Specify without VALUE to get list of supported encodings.
  --lamepreset VALUE               Override LAME preset for encoding MP3 files. 

  -q                               Be quiet
  --quiet                        
  -h                               Get help
  -?                             
  --help                         
  -V                               Display version information.
  --version