SilenceFinder cancels macro execution?

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
codebycandle
Posts: 1
Joined: Mon Feb 08, 2021 2:13 am
Operating System: Windows 10

SilenceFinder cancels macro execution?

Post by codebycandle » Mon Feb 08, 2021 5:46 am

Dear Scripting Ninjas,

Recently created a macro to handle batch processing.

Works great! -unless, it comes across a file that has "no silence' to process (as it halts subsequent execution).

Does this mean I need to create a "Nyquist Macro" script to handle "null' cases?
(-to allow handling groups of files that MAY / MAY NOT have silences to trim.)

----------
Fwiw, tried this route, but have been having trouble getting (AUD-DO "SilenceFinder") command working?

Might any kind soul have a link to a demo script using "SilenceFinder"?

(Found "InsertSilence.ny' on the forum, but looks to be v3?)
----------

-your assistance / wisdom is humbly requested!

: )
Attachments
marcro-attempt.png
marcro-attempt.png (12.1 KiB) Viewed 375 times
marcro-result.png
marcro-result.png (14.84 KiB) Viewed 375 times

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

Re: SilenceFinder cancels macro execution?

Post by steve » Mon Feb 08, 2021 10:33 am

codebycandle wrote:
Mon Feb 08, 2021 5:46 am
Works great! -unless, it comes across a file that has "no silence' to process (as it halts subsequent execution).
Is that because it is waiting for you to dismiss the "no Silences Found" message?
If you (manually) dismiss the "No Silences Found" message, does the macro continue and complete successfully or are there additional problems?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

jademan
Forum Crew
Posts: 1287
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Please select

Re: SilenceFinder cancels macro execution?

Post by jademan » Mon Feb 08, 2021 11:11 pm

codebycandle wrote:
Mon Feb 08, 2021 5:46 am
Recently created a macro to handle batch processing.

Works great! -unless, it comes across a file that has "no silence' to process (as it halts subsequent execution).

Does this mean I need to create a "Nyquist Macro" script to handle "null' cases?
(-to allow handling groups of files that MAY / MAY NOT have silences to trim.)
So I've been playing with macros a tad and I was thinking that adding a little bit of silence to every file might "fix" the problem.

The following macro should add 1 second of silence before and after the track if you have at least one second of audio to begin with:

Code: Select all

SelectAll:
Duplicate:
Select:End="999999" Mode="Set" Start="1" Track="0"
Cut:
Select:End="1" Mode="Set" Start="0" Track="0"
Silence:Use_Preset="<Current Settings>"
Select:End="999999" Mode="Set" Start="0" Track="1"
Copy:
Select:End="1" Mode="Set" Start="1" Track="0"
Paste:
Select:End="1" Mode="Set" Start="0" Track="0"
Copy:
CursTrackEnd:
Paste:
SelectAll:
SelectTracks:Mode="Set" Track="1" TrackCount="1"
Silence:Use_Preset="<Current Settings>"
SelectAll:
MixAndRender:
I am sure steve knows a much easier way to do this. :)

I hope this helps. :D

Post Reply