label_delete_audio_at
Deletes the audio under a single selected label by index, with options to close the gap and remove the leftover label marker. Keeps the timeline compact and all track positions aligned after removal.
Instructions
Delete the audio under ONE label, picked by index — not label_delete (marker only) or label_delete_regions (every label in the current selection, no index).
This is a custom, composite operation built for podcast/transcript-based editing, not a 1:1 wrapper over a single Audacity scripting command — unlike label_cut_regions/label_delete_regions/label_silence_regions/ label_split_regions/label_join_regions, which each call exactly one Audacity command. Audacity has no "delete this one labeled take" command, so this orchestrates several: SelAllTracks, then SelectTime, then Delete/SplitDelete, then clears the leftover marker.
By default the gap closes and everything after shifts left, exactly as label_delete_regions does. Pass close_gap=False to leave silence of the same length instead, keeping the timeline length and everything after it in place.
All tracks are selected first, so label tracks ripple along with the audio and later labels stay aligned with it.
Deleting the audio does NOT remove the label — it collapses to a zero-length marker sitting where the audio used to be. This tool clears that leftover marker too, matching what clicking a label and pressing Delete does in Audacity: the audio and the label both go. Pass delete_label=False to keep it as a marker of where the cut was made. Use label_delete instead to remove a label without touching any audio.
Args: index: Flat label index from label_list close_gap: Close the gap and shift later audio left. Default: True delete_label: Also remove the label left behind. Default: True
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | ||
| close_gap | No | ||
| delete_label | No |