Python Audio Tools
About
News
Installation
Quick Tutorial
Screenshots
Download
Git Access
History



SourceForge.net Logo

Prerequisites

Python 2.4.4 or higher, libcdio and Construct 2.00 or higher are required. The rest are optional but recommended in order to get the most out of these tools.

Python Audio Tools Prerequisites, by Format
FormatSuffixDecodingEncoding Metadata ReadingMetadata WritingReplayGain
RIFF WAVE.wavPythonPythonN/AN/AN/A
AIFF.aiffPythonPythonN/AN/AN/A
Sun AU.auPythonPythonN/AN/AN/A
FLAC.flacflacflacPythonmetaflacmetaflac
Ogg FLAC.ogaflacflacPythonPythonN/A
WavPack.wvwvunpackwavpackPythonPythonwvgain
MP3.mp3lamelamePythonPythonN/A
MP2.mp2lametwolamePythonPythonN/A
Ogg Vorbis.oggoggdecoggencPythonvorbiscommentvorbisgain
Ogg Speex.spxspeexdecspeexencPythonPythonN/A
M4A.m4afaadfaacPythonPythonN/A
Musepack.mpcmppdecmppencPythonPythonN/A

Installation Procedure

To install Python Audio Tools, you simply need to run:

make install

as root from the audiotools source directory. This will use the Python interpreter to install the audiotools Python module and the executable scripts. It will then install the man pages from the doc/ subdirectory. If you do not have the Construct Python module installed, you can run:

make construct_install

as root from the audiotools source directory to install it. To verify your Python Audio Tools installation, run:

audiotools-config

as a normal user. This will load the audiotools Python module, if possible, and deliver a listing of available audio formats and current system settings.

Fixing Installation Problems

  • The audiotools.cdio module doesn't build correctly

    Check that you have the CDIO library installed, commonly known as libcdio If libcdio is installed and the module still doesn't build, ensure that you've also installed any accompanying libcdio-devel package.

  • The Construct module isn't found

    Run the

    make construct_install

    command from the audiotools source directory, as root, to install this module.

  • The installer complains about missing "python/config/Makefile" of some sort

    Your distribution probably has separate "python" and "python-devel" packages and "python-devel" is not yet installed. Use your package manager to install "python-devel" and try installing Python Audio Tools again.

  • audiotools-config lists formats as unavailable

    Certain audio formats require external programs. For instance, to use FLAC files, Python Audio Tools requires the flac and metaflac programs. If these cannot be found in the regular executable search path or from the config file (which will be explained later), you will not be able to use that format. Check your system's package manager for programs which may be available but not yet installed. If that fails to find an appropriate precompiled binary for your system, use the web sites listed in the 'Prerequisites' section for download and installation instructions.

  • PulseAudio playback isn't working

    Python Audio Tools requires the pacat and pactl executables for playback via the trackplay executable. If you have the PulseAudio server installed but these aren't present, ensure you've also installed an accompanying "pulseaudio-utils" package.

    If pacat and pactl are installed and PulseAudio playback still isn't working, make sure the PulseAudio server is up and running with the following command:

    % pactl stat

  • The system configuration listed by audiotools-config is not correct

    The FreeDB server, CD-ROM device and file name format are adjustable from the audiotools.cfg configuration file, which will be covered in the next section.

  • My Python interpreter isn't found, or I wish to use a different one

    The first line of Makefile is which Python interpreter is being used for installation of both the Python Audio Tools and Construct module. For instance, to use a Python interpreter located at /opt/python/bin/python, you should change that line to read:

    export PYTHON = /opt/python/bin/python

    Running make will then invoke the new interpreter for installation of the audiotools module and scripts.

The Configuration File

Because not all systems are alike, and hard-coding values into the application is not pleasant for non-programmers, Python Audio Tools comes with a small config file named audiotools.cfg which contains user-editable values. These values include the default FreeDB server to use, the default filename format for new tracks, the default CD-ROM device to use for audio extraction/burning and, optionally, alternative paths to required executables.

The format of this file is straightforward. It consists of one or more sections. Each section contains one or more key: value pairs.
audiotools.cfg options
SectionKeyValue
[FreeDB] server the default FreeDB server hostname
port the default FreeDB server port
[System] cdrom the default CD-ROM device to use for CD reading/writing
maximum_jobs the maximum amount of processes to run simultaneously when converting tracks
[Filenames] format the default filename format for new tracks
[Binaries] flac the flac executable to use for encoding/decoding FLAC files
lame the lame executable to use for encoding/decoding MP3 files
... which executable to use other than the default

Options precedence

When Python Audio Tools needs an option, such as a FreeDB server name, it looks in the following order:

  1. The command-line. For example, specifying the --freedb-server command-line option when executing a program overrides any values in config files.
  2. The $(HOME)/.audiotools.cfg config file. This file has the same syntax as the system-wide .audiotools.cfg file. Since it need only contain the options that one wishes to override, it may be smaller than the system-wide config file.
  3. The system-wide .audiotools.cfg config file. This is often found in /usr/etc/audiotools.cfg (or wherever Python places data files).

If no command-line option is given and no config files are found Python Audio Tools will use some hard-coded default value, which may not be what you want.

The Filename Format

The default filename format is a template string which contains Python-style %(key)s wildcards which are replaced by actual values when tracks are created or renamed. Actual values are pulled from the file's own metadata or an external XMCD file.

KeyValue
%(track_number)2.2d the track's number on the CD, from 01-99
%(track_name)s the track's name
%(album_name)s the album's name
%(artist_name)s the track's artist name
%(performer_name)s the track's performer name
%(copyright)s the track's copyright information
%(year)s the track's publication year
%(suffix)s the track's suffix, based on it's file type (e.g. MP3 files will have the suffix mp3)

All other text in the format string is left as-is.