0

I like Audacity because of its noise reduction. With a recording done in studio, a noise profile, and reduction at 16 dB (with sensitivity 6.00 and 3 frequency smoothing bands), I get a perfect result without voice distortion.

I would like to automate this noise reduction process: give the software a file with the background noise, generate a noise profile, and reduce that noise in multiple other files.

Audacity allows scripting; even then, it crashes on my system, and no longer allows noise reduction:

This effect is not currently available from scripting.

I tried SOX from this thread:

sox Take80-noise.wav  -n noiseprof noise.prof
$ sox Take80.wav Take80-clean.wav noisered noise.prof 0.21

With my studio recordings and the same noise input, a level of 0.21 has very little effect, and a level of 0.6 has more effect on background noise without eliminating it and it does distort the voice.

How can I automate noise reduction with similar results as Audacity?

0

For lack of results in two months, I copy the answer from Automate pre-processing of sound (noise reduction, compressor, limiter).

I programmed an AppleScript that controls the Audacity Graphical User Interface and achieves the same result. It loads a track with the noise and gets the noise profile, loads the track with the voice, removes the noise with the previous settings, and I also included a limiter and a compressor.

set noise_track to "/path/to/noise/track.wav"
set voice_track to "/path/to/voice/track.wav"
set export_name to "voice-clean"

set short_delay to 1
set middle_delay to 5
set long_delay to 10

tell application "System Events"
    
    tell application "Audacity" to activate
    
    tell application "Audacity" to open noise_track
    
    delay short_delay
    keystroke "a" using command down
    
    
    tell process "Audacity"
        click menu item "Noise reduction..." of menu "Effect" of menu bar 1
    end tell
    delay short_delay
    
    repeat 2 times
        key code 48
        delay short_delay
    end repeat
    key code 49
    delay short_delay
    
    tell application "Audacity" to open voice_track
    delay short_delay
    
    --------------------
    -- Noise reduction
    --------------------
    
    keystroke "a" using command down
    delay short_delay
    
    tell process "Audacity"
        click menu item "Noise reduction..." of menu "Effect" of menu bar 1
    end tell
    delay short_delay
    
    key code 36
    
    delay long_delay
    
    --------------------
    -- Limiter
    --------------------
    
    tell process "Audacity"
        click menu item "Limiter..." of menu "Effect" of menu bar 1
    end tell
    delay short_delay
    
    key code 36
    delay long_delay
    
    --------------------
    -- Compressor
    --------------------
    
    tell process "Audacity"
        click menu item "Compressor..." of menu "Effect" of menu bar 1
    end tell
    delay short_delay
    
    key code 36
    delay long_delay
    
    keystroke "e" using {command down, shift down}
    delay middle_delay
    keystroke export_name
    delay short_delay
    key code 36
    
    delay long_delay
    
    --------------------
    -- Close two projects
    --------------------
    repeat 2 times
        keystroke "w" using command down
        delay short_delay
        key code 48
        delay short_delay
        key code 49
        delay 2 * short_delay
    end repeat
end tell

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.