Stop recording with a macro

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Jutzi
Posts: 22
Joined: Sun Feb 26, 2017 3:39 pm
Operating System: Windows 10

Stop recording with a macro

Post by Jutzi » Mon Jan 07, 2019 6:42 am

Seems that macros cannot be activated when recording is active. I would like to have a button assigned to a macro. Macro would the stop recording and save the result. How to do that?

Audacity 2.3.0 and Windows 10.
Macro and recording.jpg
Macro and recording.jpg (161.61 KiB) Viewed 468 times

steve
Site Admin
Posts: 81649
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Stop recording with a macro

Post by steve » Mon Jan 07, 2019 8:46 am

Jutzi wrote:
Mon Jan 07, 2019 6:42 am
Macro would the stop recording and save the result
When would it stop and save the result?

To stop recording on a key press, use Space to stop the recording.

To stop recording after a specified length of time could be done with AutoHotkey or similar. This can't be done with a macro because there isn't a timer for macros.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Jutzi
Posts: 22
Joined: Sun Feb 26, 2017 3:39 pm
Operating System: Windows 10

Re: Stop recording with a macro

Post by Jutzi » Mon Jan 07, 2019 10:49 am

Of course stop and save can be done with two key presses, one for stop and second for save.
What I am after is to do these two with one key press only. Only problem is that macro cannot be activated during recording.

steve
Site Admin
Posts: 81649
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Stop recording with a macro

Post by steve » Mon Jan 07, 2019 12:32 pm

Jutzi wrote:
Mon Jan 07, 2019 10:49 am
macro cannot be activated during recording.
That is correct.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Jutzi
Posts: 22
Joined: Sun Feb 26, 2017 3:39 pm
Operating System: Windows 10

Re: Stop recording with a macro

Post by Jutzi » Tue Jan 08, 2019 6:46 am

Sounds like that is a feature and not a bug. Could you explain why macros are disabled?

waxcylinder
Forum Staff
Posts: 14687
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Stop recording with a macro

Post by waxcylinder » Tue Jan 08, 2019 10:08 am

Jutzi wrote:
Tue Jan 08, 2019 6:46 am
Sounds like that is a feature and not a bug. Could you explain why macros are disabled?
Most things are disabled during recording - recording is seen as a critical non-interruptable activity in Audacity.

WC
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

Jutzi
Posts: 22
Joined: Sun Feb 26, 2017 3:39 pm
Operating System: Windows 10

Re: Stop recording with a macro

Post by Jutzi » Tue Jan 08, 2019 12:56 pm

This is understandable and acceptable. Would be nice to have a possibility to automate some actions connected to stop recording, though.

steve
Site Admin
Posts: 81649
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Stop recording with a macro

Post by steve » Tue Jan 08, 2019 1:32 pm

There are three forms of scripting (automation) in Audacity:
  1. "Macros" are the simplest, but also the most limited.
    A Macro is a simple list of commands that run from the top of the list to the bottom of the list.
  2. "Nyquist Macros" are a more advanced / more powerful form of scripting (https://manual.audacityteam.org/man/nyquist_macros.html).
    An important limitation of Nyquist Macros is that it is not currently possible for a Nyquist Macro to apply Nyquist effects. If you need to mix Audacity commands with Nyquist commands, then you either need to use a normal "Macro", or "mod-script-pipe".
  3. The third, and most powerful form of scripting, is to use an external scripting language such as Python to control Audacity via "mod-script-pipe".
    Mod-script-pipe is not yet shipped with Audacity, and has to be built from the source code along with building Audacity from the source code. This complication rules out mod-script-pipe as an option for most users, but hopefully mod-script-pipe will become available as a standard part of Audacity in the near future.
Stopping a recording with a script can only be done in the 3rd (most powerful) form of scripting,with "mod-script-pipe".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Jutzi
Posts: 22
Joined: Sun Feb 26, 2017 3:39 pm
Operating System: Windows 10

Re: Stop recording with a macro

Post by Jutzi » Sat Jan 12, 2019 5:38 pm

Building in Windows to enable mod-script-pipe seems to be relatively straightforward.
However, would be nice to see some documentation before doing that. Documentation page for that is currently not working.
https://manual.audacityteam.org/man/Scripting.html

Would it be possible to activate a python script during recording with one key press? That script would stop recording and save the result.

steve
Site Admin
Posts: 81649
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Stop recording with a macro

Post by steve » Sat Jan 12, 2019 6:56 pm

Jutzi wrote:
Sat Jan 12, 2019 5:38 pm
Documentation page for that is currently not working.
The page addresses are case sensitive: https://manual.audacityteam.org/man/scripting.html

Jutzi wrote:
Sat Jan 12, 2019 5:38 pm
Would it be possible to activate a python script during recording with one key press?
Probably easiest to do that with something like AutoHotKey, as that supports global shortcuts (meaning that the Python script would not need to be running or even have focus when you press the key.)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply