Export Labels

Although Audacity already has an “Export Labels” command, it is quite limited in that it only supports one text export format, with only the label times and label text. If there are multiple label tracks, exporting the labels merge all labels from all tracks into one file.

This plug-in expands the functionality, allowing the exported file to also contain the track number and/or track name.
The output text / CSV file may be tab, comma or space delimited.

Controls:

  • Export labels to: Opens file browser to select the export name and location.
  • Allow file overwrite: [Yes / No (default=No)] When “No” is selected, the plug-in will not allow an existing text file to be overwritten. Note that regardless of this setting, the file browser will prompt about overwriting files if an existing file is selected.
  • Fields to export: The next 4 controls select which attributes of the labels will be exported,
  • Text formatting: Field separator [Tab / Comma / Space (default=Tab)] Selects whether the items in the text file are separated by tabs, commas or spaces.

When installed, the plug-in will appear in the Tools menu as “Export Labels…”
exportlabels.ny (2.71 KB)

This will taste honey for me ! :smiley: :smiley:

Thanks a lot Steve, will give it a try asap. :nerd:

TESTED and ABSOLUTELY APPROVED ! :nerd:

:arrow_right: Audacity Team Rules ! :ugeek:


Just saying, I’m not a great user of spectral selection, I just know that initial label export, also export “low freq” anf “high freq” of these labels.
Just to push the button until the end and offer the full functionality, can you pretty please add these last column ? (maybe usefull for other users)
EXCEL_191129_195129_684x926.png
Now I can count these !


Thanks again.

That’s a bit awkward because the frequencies are not in the “label info” and are not formatted in exported labels in the same way as other data.

One might expect that as exported labels (without frequencies) is formatted as:

start->end->text

(where “->” represents a “tab” character)
that frequencies would be:

start->end->text->low-hz->high-hz

but for some reason known only to the developer that added frequency data to labels, it’s actually:

start->end->text
\->low-hz high-hz

For the plug-in, the label info is obtained via the “GetInfo: Type=“Labels”” command, but that command does not return the frequency data.

Understand. Label editing is probably not the most common use of audacity.
while in tracks this can benefit of a real ergonomic enhancement. (“suppr” “copy/paste” “move frome a track to another” …)

In fact you exporting script perfectly works.

Hi,

This is awsome plugin. It can help me a lot because I want to export labels to Excel, so csv format is good enough.
Can I ask for an improvement?
I would like to export time in human readable format like %H:%M:%S.%Mi (03:04:55.123) with possibilities of decimal separator depending on locales (OS settings) - instead dot use comma. It would be great to have a field “Time format” where I can define format.
And also it would be good not to export empty string when only time is exported.
Now it is

7.9		9.24		""
47.32	48.36	""
124.77	128.34	""

I would like to see (with format %M:%S.%Milisecs:

00:07,9		00:09,24
00:47,32		00:48,36
02:04,77		02:08,346

No I want to export minutes, seconds and milliseconds of time, but in future it can be hours, minutes, seconds, milliseconds

You can do the conversion in Excel: How to Convert Seconds to Hours Minutes Seconds in Excel

I am using LibreOffice Calc and have tried one of the formula from the link, and result isn’t correct. I will need more conversions. My locales use “,” as decimal separator, so during the data import float values are treated as “text” and interpreted incorrectly. Below, converted to number values are ok.
Of course, I can put it through python script to transform data to correct format, but I would like to avoid an extra steps. Just export in correct format from Audacity and import in LO Calc (or Ctr+C from exported file, Ctr+V in Calc) is what I am dream about :wink:
LO_sample.PNG

Then you need to change the locale settings in LibreOffice.
If I recall correctly, it’s something like: “Tools → Options → Language Settings → Languages”
If in doubt, look in the manual: Languages (Options)


If you want some format other than seconds, then there must be extra steps somewhere. The choice is where to put the extra steps: in the Nyquist plug-in, in the Python script, or in LibreOffice. The choice is yours, but while we are happy to help, don’t expect someone else to do it for you.

Steve what would cause the plugin export label version 3, that copied the audio filename and saved all the labels with the audio track filename. It stops after the first label, and overwrites the first label file with the new label data, but the same file name.

Christopher

I’ve just tested the plug-in with Audacity 3.2.5 and it’s working fine for me.