SoundFinder and SilenceFinder commands not accepting parameters

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
alexswak
Posts: 4
Joined: Sat Feb 27, 2021 8:46 am
Operating System: Windows 10

SoundFinder and SilenceFinder commands not accepting parameters

Post by alexswak » Sat Feb 27, 2021 8:50 am

I have a simple problem. I'm trying to run the SilenceFinder and SoundFinder commands with parameters set by me in my python script. Problem is the parameters I enter are being ignored and audacity is just running the SonundFinder\SilenceFinder commands with the last used settings.

Basically I'm trying to run:
do_command("SoundFinder: sil-lev=30.0 sil-dur=1.0")

But all is happening is:
do_command("SoundFinder:")


Is there a problem with my command and what should I do?

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

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by steve » Sat Feb 27, 2021 11:23 am

You may need to pass the full set of parameters:

Code: Select all

SilenceFinder:labelbeforedur="0" sil-dur="1" sil-lev="30"
SoundFinder:finallabel="0" labelafterdur="0" labelbeforedur="0" sil-dur="1" sil-lev="30"
Note: The next Audacity release replaces Sound Finder and Silence Finder with a new, more flexible effect called "Label Sounds".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by steve » Sat Feb 27, 2021 11:32 am

steve wrote:
Sat Feb 27, 2021 11:23 am
You may need to pass the full set of parameters:
Or maybe not. I've just tried sending:

Code: Select all

SilenceFinder:sil-dur="1" sil-lev="20"
using "pipeclient.py", and it worked perfectly.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

alexswak
Posts: 4
Joined: Sat Feb 27, 2021 8:46 am
Operating System: Windows 10

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by alexswak » Sat Feb 27, 2021 12:07 pm

Nope. I tried using the pipclient.py to send SoundFinder: sil-lev='30' sil-dur='1.0' and no luck. What could be the reason for that??

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

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by steve » Sat Feb 27, 2021 1:36 pm

Which exact version of Audacity are you using? (look in "Help menu > About Audacity")

How are you running Python? (and which version?)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

alexswak
Posts: 4
Joined: Sat Feb 27, 2021 8:46 am
Operating System: Windows 10

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by alexswak » Sun Feb 28, 2021 7:20 pm

Audacity 2.4.2 and Python 3.9 . The problem is still there, but I have another more important question regarding commands in audacity: My client is german and he is running a german version of Audacity, and I thought the scripts and commands should be the same, but for some reason they aren't. He is saying Audacity isn't recognising the english commands. Where can I find a list of the commands in other languages? Such as SilenceFinder.

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

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by steve » Mon Mar 01, 2021 12:23 am

alexswak wrote:
Sun Feb 28, 2021 7:20 pm
My client is german and he is running a german version of Audacity, and I thought the scripts and commands should be the same, but for some reason they aren't. He is saying Audacity isn't recognising the english commands.
If you share your macro text files (as described here: https://manual.audacityteam.org/man/macros.html#share) Audacity should handle the translation (it does here, but I'm using Audacity 3.0.0 (pre-release version)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

alexswak
Posts: 4
Joined: Sat Feb 27, 2021 8:46 am
Operating System: Windows 10

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by alexswak » Mon Mar 01, 2021 12:26 pm

Thanks a lot! Everything is working fine now :)

Just one more question, which might sound a bit silly, but I'm trying to export to a folder with a space in its name. Audacity is not accepting that as a parameter for Export2.

Export2: Mode=Selection Filename=(....)/Desktop/Output/2004 test4/B-Seite/Track-1.wav
Export filename must have an extension!

is what I'm getting.

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

Re: SoundFinder and SilenceFinder commands not accepting parameters

Post by steve » Mon Mar 01, 2021 3:57 pm

alexswak wrote:
Mon Mar 01, 2021 12:26 pm
I'm trying to export to a folder with a space in its name. Audacity is not accepting that as a parameter for Export2.
How are you making the Macro? The Macro Editor should automatically add quotes around the name.
If you are manually editing the macro .txt file, ensure that you include the quotes, like this:

Code: Select all

Export2:Filename="/(....)/Desktop/Output/2004 test4/B-Seite/Track-1.wav" NumChannels="2"
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply