Audacity CLI scripting

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Witiko
Posts: 13
Joined: Mon Oct 08, 2012 1:22 pm
Operating System: Linux Debian

Audacity CLI scripting

Post by Witiko » Sun Jan 24, 2016 6:49 pm

Hello there,

I was playing around with the mod-script-pipe module in an attempt to include audacity to my Makefiles and command batches. My main motivation was the ability to export Audacity projects to flac in bulk. The result of my playing around is a shell script called audacity-bridge that starts Audacity, passes the input as messages to the mod-script-pipe module and then shuts Audacity down. It sort of works, but there are several known issues. I'm curious, if any of these issues could be eliminated without updating the mod-script-pipe module, or if they are inherent to the current version of the module.

Gale Andrews
Quality Assurance
Posts: 26087
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10
Contact:

Re: Audacity CLI scripting

Post by Gale Andrews » Tue Jan 26, 2016 2:53 pm

Mod-script-pipe is experimental so totally at your own risk (but thanks for trying it).

You can run two Audacity instances (but not currently on Windows) by adding a "Portable Settings" folder to one of the folders Audacity is run from.

* The mod-script-pipe interface is blind and therefore brittle. Suppose a modal dialogue pops up, when Audacity starts up (f.ex. an orphaned files warning). This dialogue prevents the project file from being loaded, but the audacity-bridge client has limited means of detecting this.

* While the Audacity splash screen is displayed, incoming messages are silently gobbled. This is handled by adding a fixed sleep at the beginning of the script, but this solution is brittle.

* Upon receiving the Exit MenuCommand, Audacity crashes. The audacity-bridge handles this internally, so no action is required on the part of the user.
I assume those three are our bugs or limitations. Someone else said that when controlled by mod-script-pipe, Audacity crashes on quit on Linux. What OS are you on?

If you would like to submit fixes or improvements for mod-script pipe, please do so here: https://github.com/audacity/audacity/pulls.

More advanced users may find your script useful it was linked to on http://wiki.audacityteam.org/wiki/Scripts. Would you agree to that?

Thanks

Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Witiko
Posts: 13
Joined: Mon Oct 08, 2012 1:22 pm
Operating System: Linux Debian

Re: Audacity CLI scripting

Post by Witiko » Tue Jan 26, 2016 3:48 pm

Gale Andrews wrote:You can run two Audacity instances (but not currently on Windows) by adding a "Portable Settings" folder to one of the folders Audacity is run from.
What I meant was the ability to run two Audacity instances at the same time. That does not seem to be possible, but even if it were, mod-script-pipe creates a single pair of pipes per a user (not a process), so there would be currently no way to address the individual instances.
Someone else said that when controlled by mod-script-pipe, Audacity crashes on quit on Linux. What OS are you on?
Linux indeed.
More advanced users may find your script useful it was linked to on http://wiki.audacityteam.org/wiki/Scripts. Would you agree to that?
Of course. Hopefully, some people will find it useful.

Gale Andrews
Quality Assurance
Posts: 26087
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10
Contact:

Re: Audacity CLI scripting

Post by Gale Andrews » Tue Jan 26, 2016 5:41 pm

Witiko wrote:
Gale Andrews wrote:You can run two Audacity instances (but not currently on Windows) by adding a "Portable Settings" folder to one of the folders Audacity is run from.
What I meant was the ability to run two Audacity instances at the same time.
Yes I know that is what you meant. Have you tried creating the Portable Settings folder as I described? This works on Mac OS X.
Witiko wrote: That does not seem to be possible, but even if it were, mod-script-pipe creates a single pair of pipes per a user (not a process), so there would be currently no way to address the individual instances.
OK then that seems to be a limitation, possibly deliberate. But you could subscribe to audacity-devel mailing list and discuss it there if you want.
Witiko wrote:
More advanced users may find your script useful it was linked to on http://wiki.audacityteam.org/wiki/Scripts. Would you agree to that?
Of course. Hopefully, some people will find it useful.

Thanks.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply