open Audacity with a specific mp3 file and a specific label

I would like to open Audacity with a specific mp3 file and a specific label file (txt file). How can I do this from the command line?
If it is not possible? How can I format a minimal project xml file to include these two files?
Background story:
I would like to process an audio file in python and use Audiocy as a viewer where my algorithm marked segments and output these into a text file.

Thanks!

Hanan.

I don’t think that Audacity will be suitable for your requirements.

You can launch Audacity from the command line and automatically open a project, or import an audio file with this syntax:

audacity "name of file or project"

This only works with projects and audio files, it does not support importing labels.

Note that when an audio file is imported, it is not the original audio file that you see in the Audacity project, but a copy of the audio data. If you import an MP3 into Audacity and then modify the MP3, the Audacity project will not be updated.

Audacity uses files with the extension “.txt” (text files) for more than one purpose. You would need to use a new extension (“.label”?) and then teach Audacity to recognize those files as label files. It should then be pretty simple to teach Audacity to handle the new file type when it sees it on the command line. It would be trivial to make Audacity use the new extension (instead of “.txt”) when it outputs a label file.

How can I make a minimal project file to include both the labels and the audio mp3 in the same channel?

Obviously you can create such a project manually in the Audacity GUI then save it.

If the actual MP3 file and label text file never change, then opening that project from the command-line is the same as importing the MP3 file and and the labels file at the command-line (you can’t import label tracks using the command-line). Note that the Audacity GUI would open. Do you want that to happen? What is the end purpose of what you are trying to do?

Gale