Label Tracks

From Audacity Development Manual
Revision as of 18:02, 14 February 2011 by Billw58 (talk | contribs) (add notes)
Jump to: navigation, search
  • Peter 24Nov09: Checked and corrected Links
  • Peter 23Feb10: Re-checked for spelling/typos/consistency following Bill's update yesterday.

ToDo Bill Sept 7 2010 - document new sync-lock feature (was linked tracks)

FrenchFlagSmall.png

Flag_of_Holland_small.png

A "Label Track" is an additional track that can be created in your project. It is used in conjunction with audio tracks but contains no audio itself.
Features:
  • Can annotate selected points or regions of audio with text labels.
  • The labels can be moved, modified or deleted.
  • Labels can also define different points in an audio track. This is a convenient way to mark different songs in a recording then export them to differently named audio files using File > Export Multiple...
a mono track with a label track, a region label and a point label
This needs to include something that labels can also define a point (in which case they only have one handle) ; and on how to move labels (e.g. with cut and paste)
I think this is OK now - Bill Nov 10/09
  • Peter 26Nov09: I still believe that we should also have examples and discussion on point lables. Not least because the CTRL+M marker function described below inserts point labels not range labels.
  • Gale 19Dec10: I've made that clearer for CTRL + M and (crucially) for selecting labels, but I agree the use of point labels must be illustrated with at least one image. I suggest point images could be inserted underneath the image for "A single track containing an interview with questions and answers", and above the image for "Audio in track and label selected".
    • Bill 13Feb11: New images and examples of point labels added.
  • Gale 19Dec10: ToDo This page lacks any reference to 1) Paste Text to New Label (it's a handy way to move point labels without their audio region and in fact essential in default Audacity because cutting a point label with no selected text will cut the entire project); 2) moving labels with their audio region.
    • Bill 13Feb11: I'll experiment with those situations and see what I can do.
      "cutting a point label with no selected text will cut the entire project" - isn't that a bug? Certainly Edit > Cut should be disabled in that situation?
      • Gale 14Feb11: It only happens with the "Select All if none selected" Pref on and if you just click in the label and cut (thinking the click "selects" the label) or you try to delete the empty label with del and hit once too often. Edit > Cut is disabled without a selection if that Pref is off.
        • Bill 13Feb11: Aaarrrrgh! I hate that preference and always turn it off. I'll remember to toggle it when I'm testing.
  • Bill 14Feb11: New images, new text and reworked sections. See editornotes below for what was done.

Creating Labels

Bill 14Feb11:New images, but I did not touch the text

Suppose that you have a recording of an interview and you want to annotate the questions and answers so you can easily jump directly to a particular question or answer later on. Initially, you may have something like the image below. Without any annotation it's almost impossible to tell them apart just looking at the waveform.

A single track containing an interview with questions and answers.

Here, we select the first question with the mouse (below). This may require listening to the audio several times to determine the exact boundaries of the selection.

After selecting the first question.

Now click on Tracks > Add Label at Selection, or type its keyboard shortcut ( CTRL + B on Windows/Linux or CMND+B on the Mac). This creates a new label track and a blank label outlining the current selection (below).

After choosing Add Label at Selection.

The cursor is automatically positioned inside the label, so just type the name of the label and then press Enter. Pressing Enter then allows you to use any current keyboard shortcuts normally, so you could press spacebar to listen to the selection again if you wished. In the image below we've typed Question 1.

After creating a label, type its name and press Enter.

After this question comes the answer from the person being interviewed. We'll select this one by starting from the right side of the answer and dragging to the left. Note that a vertical yellow guide appears when we get to the edge of the first label, making it easy to line up the two labels (below). It's common for the next label to start exactly where the previous one ends, but it's not necessary.

Selecting the audio for the second labeled region.

Once again, click on Tracks > Add Label at Selection to create the next label, then type its name and press Enter. Then in the following image, we've added even more labels.

After adding the second label and naming it.

And here is a complete label track with several labels

A track with several labels.

Alternative Method Using Point Labels

Bill 14Feb11:New section illustrating point labels

In the example above we used region labels to mark the interview segments. We could just as easily have used point labels.

For example, we could click in the audio track at the beginning of the first question then click on Tracks > Add Label at Selection to create the point label.

A track with a single point label.

Similarly, we could click in the audio track at the beginning of the first answer then click on Tracks > Add Label at Selection to create the second point label.

A track with a two point labels.

Either method is equally valid. Region labels have the advantage that clicking in the label text selects the audio spanned by the region label, which may be useful in some situations.

Selecting a label

When you click inside a label to select it, the label is opened so its name can be edited, and the cursor point or region of audio the label corresponds to is restored. The cursor point or region will also be selected in any other currently selected audio tracks.

Audio in track and label selected.
You can also save and restore an individual selection region without adding a label, using Edit > Region Save and Region Restore.

Use TAB on your keyboard to select forwards to the next label, and SHIFT + TAB to select backwards to the previous label. If no label is selected but the Label Track has focus (shown by the yellow border), TAB will select the first label then cycle forwards through the labels, and SHIFT + TAB will select the last label then cycle backwards through the labels.

Deleting labels

There are three ways to delete labels:

  • Click on the label's title to select it, then press the Backspace key on your keyboard until the title is gone. Once the title is empty, press Enter or just press Backspace again to delete the label. Currently, it's also possible to delete a label by selecting a region over the label (be careful not to drag the selection up into the audio track as well), then Edit > Silence Audio. Both these methods will let any labels further to right retain their current position.
  • You can also select a region extending over a number of labels then use Edit > Cut (which copies the label to the clipboard) or Edit > Delete. Note however that this method currently causes any labels to right to move backwards by the amount of the deleted selection region.
  • Another way to delete labels is to just remove the label track entirely and start again. Click in the track and then choose Remove Tracks from the Tracks menu, or alternatively click in the close box in the upper-left corner of that track.
If you need to cut or delete a section of audio that lies in-between labels, select the area for deletion in both the audio track and the label track, then the labels will remain in the correct place in relation to the remaining audio.

Like everything in Audacity, any edits to label tracks can be undone.

Editing labels

Changing the length and position of labels with the mouse

You can move a label by clicking and dragging on a circle handle. You can change the length of a label by clicking and dragging on a triangle handle.

Holding SHIFT while dragging reverses this behaviour, so that dragging a circle handle changes the length of the label, and dragging a triangle handle moves the label. For example, this lets you resize a label by SHIFT-dragging a circle handle, then release SHIFT to move the resized label without having to move the mouse pointer to the triangle handle.

In the case where two labels meet, you can adjust the junction point where they meet by clicking and dragging on its circle handle.

Moving a point label

You can move a point label by clicking and dragging on the circle handle:

PointMoveBefore.png PointMoveAfter.png
Before After

Expanding a point label

You can expand a point label into a region label by clicking and dragging on either of the triangle handles:

PointExpandBefore.png PointExpandAfter.png
Before After

Moving and resizing a region label

You can move a region label by clicking and dragging on either of the circle handles:

RegionMoveBefore.png RegionMoveAfter.png
Before After

You can change the length of a region label by clicking and dragging on one of the triangle handles:

RegionAdjustBefore.png RegionAdjustAfter.png
Before After

Adjusting the junction point where two labels meet

You can adjust the junction point where two labels meet by clicking and dragging on its circle handle:

LinkedRegionMoveBefore.png LinkedRegionMoveAfter.png
Before After

Moving a label when there is a selection

Bill 14Feb11:New section

The illustration below shows what happens if you click in a label to select it, press enter, then move the label.

LabelRegionMove1Before.png LabelRegionMove1After.png
Before After

Contrast this to what happens if you click in a label to select it, then move the label.

LabelRegionMove2Before.png LabelRegionMove2After.png
Before After

Using cut, copy and paste

Bill 14Feb11:Reworked this section.
  • Updated all the images
  • Added subsection headers
  • Changed the order (standard cut/copy/paste is now first)
  • Added section to cover the peculiarities of point labels

Cutting and Pasting Region Labels

You can cut and paste region labels using Edit > Cut and Edit > Paste, but you have to make sure you don't select any audio, or you will end up cutting and pasting audio where you probably didn't intend.

In the image below, the label was selected by clicking in it, then the audio track was unselected by shift-clicking in the Track Control Panel of the audio track (this can also be done with the keyboard by up arrow then ENTER). The label was then cut to the clipboard with Edit > Cut:

image of label in label track ready for Edit Cut

To paste the label at a different point in the audio track, drag a selection in the audio track then shift-click in the label track to select it. The label can then be pasted to that spot using Edit > Paste.

image of label track after Edit Paste

Cutting and Pasting Point Labels

You can also cut and paste point labels, but the procedure is tricky. In the image below, the point label is selected for editing as in the above example with a region label, but there is no selected region in the label track.

image of label track with point label selected for editing

What happens next depends on the setting of the "Select all audio in project, if none selected" preference in Tracks Preferences:

  • if that preference is not selected, Edit > Cut will be disabled and pressing CTRL+X will do nothing
  • if that preference is selected and you do Edit > Cut, all audio and labels in the project will be cut to the clipboard.

To cut and paste a point label to a different location, first select the text of the label as shown below. Note the difference in appearance of selected label text (the text is highlighted separately from the box) versus a selected label (where the entire label box is highlighted).

image of label track with point label text selected

Do Edit > Cut - the text of the label is cut to the clipboard, leaving a label with no text. Press the delete key to delete the label. Click in the new location for the label and do Edit > Paste Text to New Label.

image of label track after Paste Text to New Label

Using the Contextual (right-click) Menu

There is also a handy feature whereby you can select an area of text in a label, then right-click (control-click on a Mac) and cut or copy that text. This allows you to click in another label, right-click or control-click, then paste that text in. So in our example you could select and copy "Question" and then paste it into the appropriate labels without having to type that word every time. The example below shows one way this can be used.

Click in a label, then select the label text. Note the difference in appearance of selected label text (as shown below - the text is highlighted separately from the box) versus a selected label (where the entire label box is highlighted). Right-click (or control-click on Mac) in the label:

image of contextual menu in a label with Copy selected

Now select the range of audio corresponding to the second question and click on Track > Add Label at Selection. Right click in the new label:

image of new label and contextual menu ready to paste text into the label

The text "Question" will be pasted into the label, and all you have to type is "2" to complete the label.

Editing multiple labels at once

Sometimes it's useful to edit multiple labels at once using a tabular view, similar to editing a spreadsheet. To do this, click on Tracks > Edit Labels, which brings up a dialog box showing all of your labels:

Edit Labels dialog box with tabular view of labels (Mac image)

Use the arrow keys to move between cells. Handy buttons in the dialog let you insert or delete labels, or import and export labels to a file (see the section on importing and exporting below).

Linking labels with audio tracks

This feature is not available in the Audacity 2.0.x series. It is still available in Audacity 1.3.9 (look in the "audacity-unstable" folder). We intend to re-enable this feature and resume work on it in the 2.1.x Beta series.
We will remove or update the "alert" text when we have the feature in some 2.0.x versions too.

This whole "Linking labels with audio tracks" section is not included in exported text thanks to the <div class="noexport"> tag.

By default, label tracks in Audacity are now linked  to the audio tracks above them, and form a track group. A track group is defined as a set of one or more audio tracks above each other, followed by a set of one or more label tracks. This is a significant change in behavior from previous Audacity versions.

Linking means that labels now remain attached to their original point or region in the audio, even when changes are made to the track length (such as by cutting, pasting or changing the speed). Thus, an action performed in any label or audio track in the group has a corresponding effect in the other tracks in the group. For example, if a group consists of one audio track above one label track, deleting part of the audio track deletes that part of the label track, and deleting part of the label track deletes that part of the audio track.

In the following example, there are two track groups. The first group comprises Audio Tracks 1 and 2 followed by Label Tracks 1 and 2, and the second group comprises Audio Track 3 followed by Label Track 3:

Two track groups before a deletion edit

Note in the image above, the highlighted selection region in the first track (from zero to six seconds on the Timeline) which extends either side of Label 1. That region is highlighted in only the first track because only the first track is selected, as shown by the different color in the Track Control Panel. If we now Edit > Delete the region, we end up with the following image, and get the same result no matter which of the first four tracks we select:

Two track groups after a deletion edit

Note that because the audio and label tracks are linked, Label 1a is deleted, and Labels 1b and 2 both move backwards six seconds. Thus Label 1b remains attached to the quieter audio it relates to, while label 2 still remains remains two seconds in front of label 1b.

The following Audacity features also work with track groups:

  • Inserting audio, whether through pasting or using the Generate effects, shifts all the grouped tracks correspondingly.
  • Dragging any track in a track group with Time Shift Tool will also move the label, and any other tracks in the group.
  • When using Effect > Change Speed and Change Tempo, tracks remain synchronized. Slowing down a track inserts silence into the other linked tracks. Speeding up a track inserts silence into that track, to achieve the same result.

Button to enable/disable linking
Sometimes you may wish to disable linking of audio and label tracks. This can be done in two ways:
  • Click the button with the chain link icon (see right) on the Edit Toolbar
  • Click "Link Audio and Label Tracks" in the Tracks Menu.

To re-enable linking, click the button or menu item again. To disable linking of a particular audio track, click on its Track Control Panel, drag it downwards then drop it underneath the last label track in the project.

Adding labels while playing or recording

One of the easiest ways to create labels is while you're playing or recording. To do this, use the command Tracks > Add Label at Playback Position or its keyboard shortcut CTRL + M. This command adds a point label at the current Audio Position indicated in Selection Toolbar, so can be used to add a label at the current recording position too.

The Add Label at Selection command for adding a region label can also be used while playing or recording - use the mouse to click and drag the selection region while you are listening to the track.

To hear a recording in progress, click Transport > Software Playthrough (on/off) - do not use this option when recording computer playback. See Why can’t I hear what I’m recording? for more advice.


Importing and Exporting labels

Labels are saved whenever you create an Audacity project. Sometimes it may be useful to use these labels in another program, for example if somebody wanted to know the time where each piece of an interview starts or stops. Audacity exports labels in a very simple tab-delimited plain text format that looks like this:

0.285874 -> 6.098646 -> Question 1
6.098646 -> 13.054914 -> Answer 1
13.054914 -> 20.916450 -> Question 2
20.916450 -> 28.777986 -> Answer 2

The first column has the start time in seconds, the second column has the end time, and the third column has the name of the label. Start time and end time are identical if the label marks the cursor position rather than a selection region. Values are separated by tab characters (shown as -> in the above). The exported file is called "labels.txt" by default. It can be opened by any text editor, or by a spreadsheet program.

You can export labels using the Edit Labels dialog box, or by selecting Export Labels... from the File menu. Labels can be imported using the Edit Labels dialog box, or by selecting Import > Labels... from the File menu.