Airtime 2 for Broadcasters

Using the import script

If you have a large number of files in your media library, importing these files one at a time into a broadcast automation system would be time-consuming and tedious. That's why Airtime includes a script that can import an entire directory of files in one go. Before performing the import, there are a number of factors which should be considered.

Metadata quality

The airtime-import script automatically imports any metadata that is in the files' ID3 tags. If these tags are incorrect or are missing information, you will have to either edit the metadata before importing them, or suffer the consequences. For example, if the tags have creator or genre metadata missing, it will be impossible to search for, playlist or schedule the media according to these criteria.

There are a number of programs available which can be used to correct mistakes or incomplete information in ID3 tags. On GNU/Linux, the program Ex Falso ( can be useful for batch setting and editing ID3 tags before importing files into your Airtime server. On an Ubuntu desktop machine, you can install this program with the command:

sudo apt-get install exfalso

After installation, you can run the program with the command:


The Tags From Path feature of this program is a particularly useful time saver if you have a large archive of untagged files. Sometimes there is useful creator or title information in the file name or directory path structure, which can be converted into an ID3 tag automatically.

Metadata in legacy character sets

Airtime expects file tag metadata to be stored in the international UTF-8 character set. Programs such as Ex Falso (described above) encode metadata in UTF-8 by default. If you have an archive of files encoded with metadata in a legacy character set, such as the Cyrillic encoding Windows-1251, you should convert these files before import.

The program mid3iconv (part of the python-mutagen package in Debian and Ubuntu) can be used to batch convert the metadata character set of files on the command line. You can install python-mutagen with the command:

sudo apt-get install python-mutagen

For example, to preview the conversion of tags from Windows-1251 (CP1251) character set to UTF-8 for a whole archive of MP3 files, you could use the command:

find . -name "*.mp3" -print0 | xargs -0 mid3iconv -e CP1251 -d -p

in the base directory of the archive. The -d option specifies that the new tag should be printed to the server console (debug mode), and the -p option specifies a preview run. This preview will enable you to confirm that the metadata is being read and converted correctly before writing the new tags.

To actually convert all of the tags and strip any legacy ID3v1 tag present from each file at the same time, you could use the command:

find . -name "*.mp3" -print0 | xargs -0 mid3iconv -e CP1251 --remove-v1

The name of the original character set follows the -e option. Other legacy character sets that mid3iconv can convert to UTF-8 include:

KOI8-R: Russian
KOI8-U: Ukrainian

GBK: Traditional Chinese
GB2312: Simplified Chinese

EUC-KR: Korean
EUC-JP: Japanese

CP1253: Greek
CP1254: Turkish
CP1255: Hebrew
CP1256: Arabic

Silence in media files

Before importing media, it is good practice to check for any silent sections in the media files. While Airtime can compensate for leading and trailing silence with the use of cue-in and cue-out points in the Playlist Builder, it is better to trim these files to the intended length before upload. This is because trimmed files do not require station staff to set cue points over and over again, as media in the Airtime storage archive could potentially be re-used for many different shows. Audacity is a cross-platform editor suitable for the task of trimming audio files, available from

Very quiet introductions or over-long fades can also lead to apparent gaps in your broadcast playout. Some audio CDs feature a 'hidden track' at the end, which in fact uses a long period of silence within the final track, rather than an actual separate track on the disc. This means that CD encoding programs will encode both the hidden material and the silence in the media file. For example, the track Debra from the CD Midnite Vultures by Beck includes hidden material preceded by seven minutes of silence, as shown in the screen shot from Audacity below.

Copying versus watching

There are three main options when using the airtime-import script: Either to copy or move files into Airtime's main storage folder, or to watch files elsewhere. Each option has advantages and disadvantages, so you will have to think about how the files will be used in your station in the long term.

  • For files that are copied or moved, you may run into problems with hard disk space if you do not remove files from the storage server periodically.
  • For files that are watched, you must make sure that the files are actually going to be there at playout time, otherwise they will be skipped. For this reason, it is not recommended to use the watch option for easily-removable storage (like MP3 players or USB memory sticks). There's a strong likelihood that the storage might be unplugged and taken away before playout time. It is also important to make sure that any external hard disk with watched files is powered on, and stays on.

The airtime-import script works from the command line, so you must first log into a console on the Airtime server. In recent versions of Airtime, you no longer need to specify the full file system path to the media files that you wish to import. Copying is specified with the copy sub-command:

airtime-import copy <directory>

where <directory> is the root directory of the media files that you wish to import.

Alternatively, you may wish to delete the files from the original location after copying them to the storage archive, which is accomplished with the move sub-command:

airtime-import move <directory>

If the new files are exact duplicates of files that have already been imported, the script will detect this.

Any users logged into the administration interface will be warned if a file import is in progress. Users assigned the admin privilege should not attempt to change Airtime's default storage directory while an import is taking place.

Watching a new folder is specified by using the watch add sub-command:

airtime-import watch add <directory>

The script will report the name of the folder now being watched, for example:

airtime-import watch add /home/daniel/Music/mp3/Beck
/home/daniel/Music/mp3/Beck/ added to watched folder list successfully

The watched folder will also be listed on the Manage Media Folders page in the Airtime administration interface. To obtain a list of currently watched folders in the server console, you can use the watch list sub-command:

airtime-import watch list

Any new files copied to a watched folder (for example, using your desktop computer's file manager) will automatically appear in the Airtime database, and are then ready for playout. In the same way, if you delete a media file using your file manager, it will be automatically removed from the Airtime database, and will no longer be available for playout.

If you wish to no longer watch a particular folder, use the watch remove sub-command:

airtime-import watch remove /home/daniel/Music/mp3/Beck
/home/daniel/Music/mp3/Beck/ removed from watched folder list successfully 

Get or set the storage folder path

The airtime-import script also enables you to read or write Airtime's storage folder path configuration. You can find out the current setting with the storage-dir get sub-command:

airtime-import storage-dir get

A new storage folder path can be configured using the storage-dir set sub-command:

airtime-import storage-dir set /home/daniel/Music/mp3/
Successfully set storage folder to /home/daniel/Music/mp3/

The storage-dir set sub-command should be used with caution on a production server, because moving the storage folder during scheduled programming has the potential to disrupt your broadcast playout.