How to control Audacity from external application?

Audio software developers forum.

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

How to control Audacity from external application?

Permanent link to this post Posted by stefan_o » Mon Jun 19, 2017 8:17 pm

Hey,
I would like to write a program (in C++) that starts record in Audacity. The idea is to set up the (digital controllable) analog source and start both at the same time, so the timing is right (I don't mind a few ms, but pressing a hardware button and a software one simultaneously is annoying).
All I want is to start record in the current state of Audacity, nothing else. What is the best way to achieve that? Does any plug-in infrastructure provide that function?
Best regards
Stefan
stefan_o
 
Posts: 3
Joined: Mon Jun 19, 2017 8:07 pm
Operating System: Linux Mint

Re: How to control Audacity from external application?

Permanent link to this post Posted by steve » Mon Jun 19, 2017 8:31 pm

The "best" way is probably to use a different program for recording. For example, SoX http://sox.sourceforge.net/
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 44159
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: How to control Audacity from external application?

Permanent link to this post Posted by stefan_o » Mon Jun 19, 2017 9:11 pm

That is not a good solution, I need a software with GUI so the user sees what is going on. All I want is to send a signal to Audacity as if the record button was clicked.
stefan_o
 
Posts: 3
Joined: Mon Jun 19, 2017 8:07 pm
Operating System: Linux Mint

Re: How to control Audacity from external application?

Permanent link to this post Posted by steve » Mon Jun 19, 2017 9:30 pm

stefan_o wrote:All I want is to send a signal to Audacity as if the record button was clicked.

Audacity is very much a GUI application. Interacting with it from another application is not simple.

One way that can work is to use a third party app such as AutoHotKey or AutoKey to emulate key/mouse actions.

The other method is to build Audacity from the source code and build the optional mod-script-pipe. See: http://manual.audacityteam.org/man/scripting.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Senior Forum Staff
 
Posts: 44159
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: How to control Audacity from external application?

Permanent link to this post Posted by stefan_o » Mon Jun 19, 2017 9:56 pm

So I need an external tool to simulate a key press. It seems that xdotool / libxdo is the easiest. Only problem is to find out the ID of the window. Audacity seems to have 8 windows, and only one is the correct one...
stefan_o
 
Posts: 3
Joined: Mon Jun 19, 2017 8:07 pm
Operating System: Linux Mint


Return to General Audio Programming



Who is online

Users browsing this forum: No registered users and 1 guest