Decoded, the binary XML is an XML
document with the same elements as the older .aup files. The header the
writer emits is stored as FT_Raw fields and skipped on reading. It is an XML
declaration with standalone="no" and this DOCTYPE:
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN"
"http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
Audacity’s forum has said this DTD is badly out of date, so the source code is the reference used here.
The element tree
project
├── tags
│ └── tag
├── wavetrack
│ └── waveclip
│ ├── sequence
│ │ └── waveblock
│ ├── envelope
│ │ └── controlpoint
│ └── waveclip (a cutline, same shape)
├── labeltrack
│ └── label
├── timetrack
│ └── envelope
└── notetrack
project
| Attribute | Meaning |
|---|---|
xmlns | http://audacity.sourceforge.net/xml/ |
version | The document format, 1.3.0, written "%i.%i.%i". Audacity refuses a file with a version newer than its own. |
audacityversion | The version of Audacity that wrote the document |
projname | Name of the _data folder, in .aup files only |
sel0, sel1 | Selection start and end |
vpos, h, zoom | View position and zoom |
rate | Project sample rate |
Attributes after version and audacityversion are added by the
modules that register with the project. A file can hold others that are not listed
here, and a reader should skip them.
wavetrack
A stereo track is written as two wavetrack elements, the first with
linked set.
| Attribute | Type | Meaning |
|---|---|---|
name | string | Track name |
isSelected | boolean | Whether the track is selected |
channel | integer | 0 left, 1 right, 2 mono; written for older versions |
linked | integer | Non-zero marks the start of a stereo group |
rate | real | Sample rate, 1 to 1,000,000 |
gain | real | Track volume |
pan | real | −1 to 1 |
sampleformat | long | The track’s sample format |
offset | real | Read only, from old projects |
mute, solo, height, minimized | Track panel state, seen in a sample file and added by track attachments |
waveclip
A clip is one continuous piece of audio on a track. A clip with no samples is not written.
| Attribute | Type | Meaning |
|---|---|---|
offset | real, 8 places | Time of the sequence’s start |
trimLeft, trimRight | real, 8 places | How much of the clip’s edges is trimmed |
centShift | integer | Pitch shift in cents |
pitchAndSpeedPreset | long | Preset enumeration value |
rawAudioTempo | real, 8 places | The audio’s tempo; 0 when unset |
clipStretchRatio | real, 8 places | Stretch applied to the clip |
name | string | Clip name |
The clip’s children are a sequence per channel, an envelope
of volume points, and any number of nested waveclip elements, the audio
kept behind a cutline.
sequence and waveblock
| Element | Attribute | Type | Meaning |
|---|---|---|---|
sequence | maxsamples | integer | Largest block, in samples. Must be between 1,024 and 67,108,864. |
sequence | sampleformat | integer | Stored sample format |
sequence | effectivesampleformat | integer | The format the data is really at, added in Audacity 3.0.3 |
sequence | numsamples | 64-bit | Total samples. Corrected, and the file flagged, if it does not match the blocks. |
waveblock | start | 64-bit | The block’s first sample within the sequence |
waveblock | blockid | 64-bit | The row of sampleblocks. A value of zero or less is a silent block of that many samples. |
envelope
| Element | Attribute | Type | Meaning |
|---|---|---|---|
envelope | numpoints | integer | Number of controlpoint children. Must not be negative. |
controlpoint | t | real, 12 places | Time of the point |
controlpoint | val | real, 12 places | Value at that time |
labeltrack and label
| Element | Attribute | Meaning |
|---|---|---|
labeltrack | numlabels | Number of labels. Must not be negative. |
labeltrack | name, isSelected | Common track attributes |
label | t, t1 | Label start and end, in seconds |
label | title | Label text |
timetrack
| Attribute | Type | Meaning |
|---|---|---|
name, isSelected | Common track attributes | |
rangelower, rangeupper | real, 12 places | Range of the time warp |
displaylog | boolean | Logarithmic display |
interpolatelog | boolean | Logarithmic interpolation |
A timetrack has one child, an envelope.
The older .aup form
Projects before Audacity 3.0 are this XML as a plain text .aup file, with
the audio in small files under a <projname>_data folder. Each
waveblock has a simpleblockfile child with
filename, len, min, max and
rms attributes, or another type of block file such as
pcmaliasblockfile.
Not confirmed
- The attributes of
notetrack. - The full list of
projectattributes and track attachments in each version. - The numeric values of
pitchAndSpeedPreset.