How to import playlists

From Audacity Wiki
Jump to: navigation, search

Converting a playlist to the LOF format

Popular playlist formats like M3U, PLS or RMP are not supported by Audacity. However, these files are simple text files that can be converted to the LOF file format that Audacity can open.

After exporting the playlist from your favourite media player you can open it in a text editor. You should notice that it mainly contains a listing of file names with some additional information about these files.

Strip all additional information, just keeping each file name in a separate line.

You should now add the key word "file" in front of each file name and put the file name in double quotes (see example file below). Save the file with the ending ".LOF" and you are done. You can now import or open the file in Audacity.

Note that Audacity cannot open files stored on the internet that are represented in the LOF file by a URL.

Special characters in file names

If you experience problems in Audacity when the file names contain special or foreign characters, then on Windows you can convert the names into the 8.3 filename , otherwise known as short file name (SFN). On Windows if you open a command prompt at the directory containing your file and type dir /X, you will see a listing of the directory with the SFN alongside the long filename.

Information about LOF from the source code

BNF syntax

The syntax for an LOF file, denoted by <lof>:

<lof> ::= [<window> | <file> | <#>]*
<window> ::= window [<window-parameter>]* <newline>
<window-parameter> ::= offset

Example LOF file

# everything following the hash character is ignored
window # an initial window command is implicit and optional
file "C:\folder1\sample1.wav"   # sample1.wav is displayed
file "C:\sample2.wav" offset 5  # sample2 is displayed with a 5s offset
File "C:\sample3.wav"             # sample3 is displayed with no offset
window offset 5 duration 10    # open a new window, then zoom to display
# 10 seconds of the track from 5 seconds to 15 seconds, offsetting it by 2.5 seconds

file "C:\sample3.wav" offset 2.5


There are two commands: "window" creates a new window, and "file" appends a track to the current window and displays the file there. The first file is always placed in a new window, whether or not an initial "window" command is given.

Commands have optional keyword parameters that may be listed in any order. A parameter should only occur once per command. The "offset" parameter specifies a time offset. For windows, this is the leftmost time displayed in the window. For files, the offset is an amount by which the file is shifted in time before display (only enabled for audio; not midi). The offset is specified as an integer or decimal number of seconds, and the default value is zero.

Any window may also have a "duration" parameter, which specifies how much time should be displayed in the window. The default duration is equal to the duration of the longest track currently displayed.