Audacity v1.3.13-beta, Mac OS X v10.6.8
Audacity’s noise filter is basic, but reasonably effective. It is applied in two stages, (a) get noise profile, and (b) remove noise.
http://wiki.audacityteam.org/index.php?title=Noise_Removal
I find that there are two issues with applying it. First, Audacity doesn’t have keyboard shortcuts for effects (filters), other than cmd-R (repeat last effect), which is anyway valid only for the current doc. (Maybe it does, but I missed them?)
Second, I find its application somewhat counterintuitive. Thus, say I call the effect and define a noise profile; and then, I press cmd-R. This should mean, repeat “the last applied effect using the same option and without displaying the dialog”, ie, re-define the noise profile. But instead, Audacity applies the noise removal as set. IOW, invoking cmd-R doesn’t repeat stage (a), but applies stage (b).
Audacity doesn’t support AppleScript; but it is possible to script it with GUI scripting. And it turns out that it is quite easy to use GUI scripting to manipulate the Noise Removal effect.
(To use GUI scripting, it has to be enabled in System Prefs. Check Help on how to enable it and how to start UI scripting.
Try these articles
http://www.macosxautomation.com/applescript/uiscripting/
http://www.mactech.com/articles/mactech/Vol.21/21.06/UserInterfaceScripting/index.html
which are still valid and give a more detailed intro to the topic.
**Note:**In Mountain Lion, the System Preference to look for is called “Accessibility”.
You should also enable your Scripts menu (AppleScript Editor prefs). This will give you access to scripts supplied with the OS and to any scripts you place in <~/Library/Scripts>. Moreover, if you create inside the latter folder a folder called “Applications” and, inside it, one called “Audacity”, scripts placed in <~/Library/Scripts/Applications/Audacity> will appear in the Script menu only when Audacity is frontmost.)
Below are two AppleScript scripts. Copy each to a blank AppleScript Editor doc and save in <~/Library/Scripts/Applications/Audacity> as plain scripts. I called them “Noise - Get Profile.scpt” and “Noise - Remove.scpt”. Use a keyboard shortcuts manager (I prefer Spark http://www.shadowlab.org/Software/spark.php) to assign them shortcuts. Then, in Audacity, select some noise, invoke the first shortcut, then select all the sound to be processed, and invoke the second shortcut. (Of course, instead of invoking the second shortcut, you could just use Audacity’s cmd-R.)
Please note I’ve only tested these scripts on a few docs; they should work, but there are no guarantees, and I can not support them – you’re on your own. It’s more a case of using them as examples to write your own scripts and improve your workflow when using Audacity.
Noise - Get Profile
(*
- UI scripting must be enabled
- tested only on Mac OS X v10.6.8 and Audacity v1.3.13-beta!
- use at your own risk
*)
on run
tell application "System Events"
tell process "Audacity"
set frontmost to true
try
click menu item "Noise Removal..." of menu of menu bar item "Effect" of menu bar 1
click button "Get Noise Profile" of window "Noise Removal"
end try
end tell
end tell
end run
Noise - Remove
(*
- UI scripting must be enabled
- tested only on Mac OS X v10.6.8 and Audacity v1.3.13-beta!
- assumes Noise > Remove option is selected
- use at your own risk
*)
on run
tell application "System Events"
tell process "Audacity"
set frontmost to true
try
click menu item "Noise Removal..." of menu of menu bar item "Effect" of menu bar 1
click button "OK" of window "Noise Removal"
end try
end tell
end tell
end run