yonilevy / noiseclean

A simple bash script to remove audio noise from audio and videos files.
112 stars 16 forks source link

How can I run it with python script ? #7

Open RoiBites1515 opened 3 years ago

RoiBites1515 commented 3 years ago

I would love to know how can I run it with python script, Thanks.

markelwin commented 2 months ago

@RoiBites1515 and those who enter via search engine.

The script worked wonderfully for me. As of the time of this posting the read statements within the script require three user inputs and each specify defaults. Because these specify defaults they can be bypassed on the command line, which answers the original question. For simplicity and clarification the parameters and defaults at the times this post are:

Sample noise start time [00:00:00]: 
Sample noise end time [00:00:00.500]: 
Noise reduction amount [0.21]: 

read can always be bypassed by piping in through an echo statement such as described here.

echo | ./noiseclean.sh input.wav output.wav will bypass the read statements and use their defaults.

To use through Python simply requires the subprocess module:

import subprocess
cmd = "echo | ./noiseclean.sh input.wav output.wav"
subprocess.run(cmd.split())