Muting tracks with older version of Audacity and mod-script-pipe

Questions, discussion and recipes for scripting and batch processing in Audacity.
See also the "Scripting" section of the Audacity manual.
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
drneon
Posts: 8
Joined: Sun Nov 15, 2020 2:40 pm
Operating System: GNU/Linux other

Muting tracks with older version of Audacity and mod-script-pipe

Post by drneon » Thu Nov 19, 2020 3:00 am

Currently running an older version (2.2.2) of audacity due to difficult building a newer version with mod-script-pipe on Raspberry Pi. I have mod-script-pipe working but I can't find any documentation regarding available commands...a few commands work (such as those in the examples in the piped-work directory) but much of what is listed in the scripting documentation doesn't seem to work and instead yields a "Your batch command of XXXX was not recognized " error.

I'd like to mute and unmute tracks via the scripting interface, but the toggle nature of "MenuCommand: CommandName=TrackMute" (which does mute or unmute the selected track) is problematic. Is there a list of commands that will work for 2.2.2, or a way in which I can use this version to get something that will allow me to define the mute status of a particular track (instead of just toggle it)? SetTrackAudio doesn't seem to work. "MenuCommand: CommandName=Play" and "MenuCommand: CommandName=Stop" do seem to work.

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

Re: Muting tracks with older version of Audacity and mod-script-pipe

Post by steve » Thu Nov 19, 2020 9:06 am

drneon wrote:
Thu Nov 19, 2020 3:00 am
Is there a list of commands that will work for 2.2.2,
I don't know, but if there is it will be in the Audacity 2.2.2 manual.
If you don't already have it, the 2.2.2 manual is available here: https://www.fosshub.com/Audacity-old.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

drneon
Posts: 8
Joined: Sun Nov 15, 2020 2:40 pm
Operating System: GNU/Linux other

Re: Muting tracks with older version of Audacity and mod-script-pipe

Post by drneon » Thu Nov 19, 2020 2:05 pm

This is helpful, thanks! The problem I'm having now is that I can't seem to select a track from the scripting interface. The "Select: Trackname=XXX" command works successfully, but then if I run "MenuCommand: CommandName=TrackMute" it does not mute the track that I told it to select, but instead the one that was previously selected manually in the GUI. Same problem if I select by track index. Am I missing something here? How do I select a track and then mute/unmute it with a script? I realize this is with an older version of the scripting interface, but would certainly appreciate any guidance.

EDIT: Nevermind, I was just able to get something working with the old syntax for SetTrackInfo...even though the 2.2.2 manual suggests that this only works to set the track name in this version, it does seem to be functional for mute state as well. I think that'll solve my problem and avoid using the Select: command

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

Re: Muting tracks with older version of Audacity and mod-script-pipe

Post by steve » Thu Nov 19, 2020 2:20 pm

Have you tried using pipeclient.py from the command line interface? That's a convenient way to test commands.

This works for me (though I'm using a later version of Audacity):

Code: Select all

Enter command or 'Q' to quit: TrackMute:
Sending command: TrackMute:
BatchCommand finished: OK
Execution time: 28.57ms

9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

drneon
Posts: 8
Joined: Sun Nov 15, 2020 2:40 pm
Operating System: GNU/Linux other

Re: Muting tracks with older version of Audacity and mod-script-pipe

Post by drneon » Thu Nov 19, 2020 5:20 pm

Yes, pipeclient.py is quite helpful for troubleshooting. The problem was really figuring out what the commands were since the scripting language has evolved quite a bit since the version I'm using. But the older version of the manual you pointed me to has some helpful information on that particular iteration (2.2.2) of the scripting interface. Still not sure why the "Select: " command wasn't doing what I wanted (it wasn't returning an error or failure, but wasn't correctly selecting a track even after completing successfully), but in the end I could accomplish what I needed with "SetTrackInfo: " Thanks for the help!

Post Reply