Can specific scripts be run from a terminal to automate certain tasks?

I have accomplished my primary objective of creating a silence file with a python script. My programming skill will always be very rudimentary as I am unfit to be a competent programmer.

So my python script suffers from many limitations. The complete and operational program is at the stackoverflow website. If perused, the difficulties encountered could be found out.

Therefore, my automatic question would be:
could the objective be accomplished automatically by a script from the terminal with audacity?

It would be unreasonable to assume that it can’t be accomplished with Audacity, as I can always manually create a silence file by choosing the silence sections by hand, watching the waveform.

So could I please be suggested a script which uses audacity from the terminal that could process a .ogg audio file from the HDD in chunks and write the necessary chunks back to the HDD under the same directory as that of the main .ogg file, using the RAM optimally and minimally for the work?

So apparently your brief is to ignore audio above a threshold.

This is possible with Steve’s inverted-gate plugin called PopMute.

What remains will be faint recorded audio & inevitable noise generated by electronics. That’s Rorschach audio territory.

Thank you, Mr. Trebor, for your prompt support.

I consider my responsibility to explain my objective: this way I create a noise file which I could then paste at the end of the .ogg file and use it for the purpose of Noise Reduction, then truncate silences, change the tempo a bit and shorten the filesize and audio length.

If you’re using it as a noise-reduction profile,
I would not change the tempo of it, as that will introduce artifacts.
It’s then a less accurate representation of the noise.

“After” …
Later, when all operations have been done with.
BTW, couldn’t download the plugin from Missing features - Audacity Support
You are aware that I am a little less gifted up there on these matters :slight_smile:

Ah, Got! It is in https://plugins.audacityteam.org/nyquist-plugins/effect-plugins/dynamics-processing#pop-mute
Is this the one?

Yes …
popmute muting

BTW the low volume signals may not necessarily represent unwanted noise: they could be reverb from the signal you want to keep.

But my python script is perfect in the result that I seek.

Now coming to the plug-in popMute:

I thought I understand intuitively the sub-tools, “Threshold”, “Mute Level”, “Look Ahead”, “Release Time”, etc. But I don’t, in this regard. So what is it? Why can this “Threshold” not go above -24dB.
What is “Mute Level”?
What is “Look Ahead”?
What is “Release Time”?

You must remember that I am a novice.

Please try your best to explain the issues to an average standard-10 school-going boy.

I have tried the plug-in. Prima facie, it doesn’t fulfil my objective: the objective that has been fulfilled with my python script.

The only problem with my script is explained in the original post/question at the stackoverflow forum. It processes the entire operation from RAM, uploading, processing and creating files on the RAM itself, rather than using the HDD, optimising the operations.

Now on your suggestion on the plug-in PopMute: In that case, can’t my method be automated into a macro, say find and append the silence areas based on my pre-determined threshold and add it two seconds after the main audio. Then have that section selected as the Noise. Then have Noise Reduction applied on to the main section. Then Truncate the file to eliminate the silence areas, then change the Tempo from 60 beats pm to 72-78 bpm, then export the file?

Or at least, the creation of a Silence (i.e., background noise) File from within the audacity program? That way, our systems will not be brought to a near stand-still.

-24dB is a reasonable value for the PopMute purpose.
If you need the threshold to be set lower,
change this value in the PopMute script, to say -100 …

change -24 to say -100

-100dB is essentially true silence.

Apologise that I was editing the post number 7 while you posted your reply. Thank you. I request you to kindly peruse the post no.7 once more. Please. You have provided me a great deal of support since I joined this forum. Please oblige me with some more.
Please also explain the functionalities of “Look Ahead” and “Release Time”.
BTW, I have changed the Threshold to -65 dB and Mute to -100 dB. Look Ahead and Release Time to 1ms each. I will check and then report back.

May please my last post requesting further explanation from Mr. Trebor be perused.

I am aware that it is purely out of voluntary kindness that Mr. Trebor, Mr. Steve and a few other senior and experienced leaders of this forum help learners such as me, without vanity or airs.

I am certain that I couldn’t explain my perspective to Mr. Trebor clear enough for him to understand my specific concerns and consider clarifying my doubts. So I shall try to clarify myself further, unsure whether I would at all be able to:
I have read the notes in the file, popmute.py The explanations are fairly straightforward. Mr. Trebor must have been confused by my seeking further inputs when the explanations were already there.

My point is that I don’t have a crystal clear idea about the sound profiles of pop, click, clap and other noises in isolation to have a general understanding how to set up the filters to remove them. Assuming that the sampling rate is 44100Hz, I don’t have a clear idea of how pop, click, clap and other noises, such as white, brown, etc., noises might actually look like.

Presently, what popmute.py does for me is to isolate the silence areas that contains simple noises so that I could sample the entire file with the Noise Reduction Effect and then proceed to clean up the targetted audio file.

I would be much helped by a sound sample file of 2-4 minutes having these noises of varying patterns and amplitudes so that I understand it better how the popclick.py proceeds to eliminate these noises.

Also, I don’t have any clear idea about how the Effect “Noise Reduction…” works.

Any input would be welcome. It would be much appreciated if any 101 textbook could be suggested for this objective.

IMO 1ms is too short: it could create clicks which are not representative of the noise you’re trying to remove. Plus, if there is any reverberation in your recording it will not have died-off much in 1ms, the residue will contain reverb which is very similar to the noise you want to keep.
10ms seems more reasonable to me.

Mr. Trabor thank you for replying back. I was only concerned with the background noise contained in the “silence portions” of the audio file that fell below -60 dB. The rest: pop, click, clap and other noises, etc., would have been addressed later, when the primary objectives were met.

Please ignore the rest other than the requests in the latest post and oblige me, like you have always done.

Why I want to target the “silent portions” first? Using repeated “noise reduction” I aimed to clean up the “silent portions”, then use “Truncate Silence…” effect to remove them and reduce the file size.

You will generate click noises in your noise-profile residue if you have attack & release of only 1ms. Those clicks will corrupt the noise data you’re trying to collect.

BTW despite the name “PopMute” it does not specifically act on pops.
PopMute just like a noise-gate, but upside-down: it admits low volume, and blocks the louder signal.

Here are the result of my experiment.

I altered the popmute.py file values as:

I isolated the portion that I consider noise.

I analyse the segment using AnalyzeMeasure RMS to find the value as -87.1522 dB

The sound profile:

After various values, I find that with:
;control thresh "Threshold" real "dB" -37 -100 0
the profile isn’t changed in any significant way.

So my present confusion is this:
RMS shows -87.1522 dB of a noise segment.
popmute uses -37 to isolate that particular noise segment.

I find no parity or relationship between the two values.

But what I am able to do is to subject the entire file to the popmute.py with the value that I have set. Isolate the silence part that I consider as noise. Then use Truncate Silence… to remove the silence areas. Have only the noise profile. Then use this file as the one to use for Noise Reduction.

Hence, my other post at: What’s the path-directory where the Temporary file from “Get Noise Profile” is saved?