30 Second Samples Batch Macro

Hi there. Hope you can help me. Just can’t seem to get my head around a simple macro. Trying to create a macro to: (1) jump in 15-seconds to a track, (2) select a 30-second snippet, and (3) export as an mp3. That 2nd part is tripping me up. Any help? Thank you.

The problem with the export part is there in not (not in 3.4.2 anyway, there may be so in the upcoming 3.5) a macro command to Export Selection.

So (assuming you know how to make the selection in the macro the add the following macro commands

0. make selection

  1. Trim Audio
  2. Export as MP3
  3. Undo

The undo will revert the trim and restore the rest of your audio.

Peter

1 Like

Thanks for your reply, Peter – and love your username! I don’t understand your solution. To create a macro to select 30-second snippets after the 15-seconds mark into a track, I first delete the initial 15-seconds. How do I then delete everything after the 30 seconds mark? Thanks again.

SelectTime:End=“15” Start=“0”
Delete:
SelectTime:End=“???” RelativeTo=“???” Start=“???”
Delete:
ExportMp3:

If it is for batch processing:

SelectTime:End="45" Start="15"
Trim:
ExportMp3:

If it for applying to the current project rather than batch processing:

SelectTime:End="45" Start="15"
Trim:
ExportMp3:
Undo:

The “Undo:” is to undo the trim command. With some versions of Audacity it may be necessary to have more than one “Undo:” command so as to step back to undo the trim (the “ExportMP3” will not be undone).

1 Like

Thank you so much, Peter and Steve! You led me right to what was needed. Can stop banging my head on the table now. :smiley: Many thanks, really appreciate your assistance. :+1:

SelectTime:End="15" Start="0"
Delete:
SelectTime:End="30" Start="0"
Trim:
ExportMp3:

You don’t actually need to delete 0 to 15 seconds. “Trim 15 to 45” deletes everything outside of the selection, so it deletes 0 to 15 and 45 seconds to end of track in one go.

A disadvantage of deleting 0 to 15 first is that it may cause unexpected wrong results if there are splits in the track. The solution that I posted is more robust.

1 Like

When I tried that suggestion the results were 45-second samples with 15-seconds of silence at the start. Something is set up differently on my machine, I guess. Thanks again for your help. You two gave me “trim” which I had never used.