I am recording over 1,000 audio clips for an audio project. Unfortunately, most of these clips have a loud noise at the very start and very end. This noise is most likely me pressing the toggle button for recording.
I want to silence the first and last 0.5 seconds of each clip. I have already used PyAudacity to automate some things for this project, but I have come to a problem I’m having trouble solving on my own.
Each clip is unevenly sized. So I can’t do fixed intervals.
Would it be possible to program something like:
Select the start of a clip (boundary)
From there, select 0.5 seconds to the right
Silence audio selection (Ctrl +L)
Move the selection line to the end of the clip
Silence 0.5 seconds to the left.
Rinse and repeat?
I attempted to attach a screenshot because visual aid helps sometimes. If there’s any other factors you need to know if you are trying to help me, let me know.
NOTE: I don’t wish to add new silence to the clip. I want to silence the first and last 0.5 seconds of each clip.
NOTE: I have also tried the click removal tool to no avail. It either badly damages the quality of the audio or does not remove the starting click sounds well enough.
Hello! In the Audacity program, the cursor can be programmed to jump for at least 1 second, so cursor jumping for 0.5 seconds will not work. If you are satisfied with the silence of the sound at intervals of 1 second, then you can write such a macro as you need. But in your case I would apply Noise Gate. Set the appropriate threshold and it will automatically silence quiet areas. This is the easiest working solution
Thank you for your response. Unfortunately, some of the recordings have vital parts that are about as loud as the extraneous noises. So I must go with the more complicated option.
If your clips are contiguous (as shown in your screen shot) the attached macro implements the steps in your first post.
Download the macro file and put it in the Audacity Macros folder. Location will vary by operating system; see Macros - Audacity Manual
From Tools > Macro Manager click “Import Macro” and import the “SilenceStartAndEnd” macro.
In Audacity > Preferences > Keyboard Shortcuts, apply a simple shortcut to the macro.
Start by placing the cursor at the start of the track.
Run the macro. The first clip should have the first and last 0.5 seconds silenced. The cursor should be at the start of the next clip.
Run the macro again and again until all clips have be processed.
And don’t wrack your brain how to rename files. Export them with Audacity, with the names they have now, then use mp3tag to batch rename based on the their tags in seconds
The attached macro will add one second the start and end of each clip.
To use it, first create a new track, generate 1 second of silence into that track, select the 1 second of silence, copy, then select the first track and move the cursor to the start of the track.