Skip to content

Remove space between clips #3924

Closed as not planned
Closed as not planned

Description

@JC3

Your idea

Please add a "remove space between clips" menu item that removes gaps between clips.

Dragging the clips together is a no-go if there's more than a handful of them. The go-to workaround of using "Truncate Silence" doesn't actually work if your clips contain silence, or they contain sound < -100dB (an unnecessary lower limit in the Truncate Silence dialog), or they are closer than 0.1 seconds (another unnecessary lower limit in the Truncate Silence dialog). Plus it's slow since it scans the audio, which is not necessary for this use since Audacity already knows where clip boundaries are.

This is a very basic feature.

Generally speaking, Audacity fails in use cases that involve labelling areas to keep rather than labelling areas to cut during editing (there is for example "Split Delete" but no direct "Split Trim" or whatever you'd call it).

Problem to be solved

Removing gaps between clips.

Prior art

Literally every application (audio or not) that works with clips of anything has the ability to remove the space between them.

Additional context

No response

Activity

  1. added
    Enhancement Request
    on Nov 13, 2022
  2. added
    medium feature
    on Nov 14, 2022
  3. JC3 commented on Nov 14, 2022

    @JC3
    ContributorAuthor

    Related: #3933

  4. JC3 commented on Nov 14, 2022

    @JC3
    ContributorAuthor

    Related: #3934

  5. moved this from Undecided to timeline: 3.x in Feature Requestson Nov 28, 2022
  6. SteveDaulton commented on Nov 28, 2022

    @SteveDaulton
    Member

    Please add a "remove space between clips" menu item that removes gaps between clips.

    That's been available for years. Use "Truncate Silence" (set to "Truncate" rather than "Compress"). See: https://manual.audacityteam.org/man/truncate_silence.html

    Note that in Audacity 3.1.0 it is necessary to enable:
    "Preferences > Track Behaviors -> Editing a clip can move other clips".

  7. JC3 commented on Nov 30, 2022

    @JC3
    ContributorAuthor

    @SteveDaulton wrote:

    That's been available for years. Use "Truncate Silence" (set to "Truncate" rather than "Compress"). See: https://manual.audacityteam.org/man/truncate_silence.html

    As I stated already:

    The go-to workaround of using "Truncate Silence" doesn't actually work if your clips contain silence, or they contain sound < -100dB (an unnecessary lower limit in the Truncate Silence dialog), or they are closer than 0.1 seconds (another unnecessary lower limit in the Truncate Silence dialog). Plus it's slow since it scans the audio, which is not necessary for this use since Audacity already knows where clip boundaries are.

  8. self-assigned this
    on Feb 20, 2023
  9. JohnColket commented on Feb 21, 2023

    @JohnColket
    Contributor
  10. tondeaf commented on Jul 8, 2023

    @tondeaf

    This isn't about removing silence FROM clips, it's about removing EMPTY SPACE BETWEEN clips.

  11. djhend commented on Nov 19, 2023

    @djhend

    I could really use this feature at the moment. I've received the 14x32 track wav files from a concert recording and lining them all up is proving very time consuming. Any magic ideas? Running version 3.3.2 Build from May 5, 2023

  12. unfor19 commented on Dec 21, 2023

    @unfor19

    @JC3 @djhend @tondeaf I've created this Python package - unfor19/audacity-scripting.

    You can install it with:

    python -m pip install audacity-scripting

    Then run the CLI command:

    audacity_scripting clean-spaces --path "/path/to/my_project.aup3"

    The above command copies the original file and removes spaces (gaps) between audio clips from the copied file.

    Let me know if it works for you. Feel free to let me know if you have any suggestions for improving this tool.

  13. SteveDaulton commented on Dec 22, 2023

    @SteveDaulton
    Member

    unfor19 How do you work around #4220 ?

  14. unfor19 commented on Dec 22, 2023

    @unfor19

    Hi @SteveDaulton, first, I'd like to say thank you for Audacity and the well-documented process for building it locally; it was super easy.

    When I use the GetInfo, I round everything to 5, see:

    I had some cases where start and end were opposing for some clips, so I filtered them out:

    source

                for raw_clip in clips_sorted:
                    if raw_clip['start'] >= 0.0 and raw_clip['end'] > 0.0:
                        raw_clip['_id'] = "" + \
                            str(raw_clip['track']) + \
                            str(round(raw_clip['start'], 5))

    I calculate new positions of clips in a track with gaps by calculating their duration; After I know the duration of the first clip in the track, I add the other clips to the end of it according to their duration.

    When it comes to precision, I did see some gaps when I used round(, 4), so I used round(, 5), and now everything works perfectly.

    I hope that answered your question; I'm not sure it did, as I didn't experience too many "precision issues."

  15. SteveDaulton commented on Dec 22, 2023

    @SteveDaulton
    Member
  16. mppooks commented on Mar 7, 2024

    @mppooks

    Your idea

    Please add a "remove space between clips" menu item that removes gaps between clips.

    Dragging the clips together is a no-go if there's more than a handful of them. The go-to workaround of using "Truncate Silence" doesn't actually work if your clips contain silence, or they contain sound < -100dB (an unnecessary lower limit in the Truncate Silence dialog), or they are closer than 0.1 seconds (another unnecessary lower limit in the Truncate Silence dialog). Plus it's slow since it scans the audio, which is not necessary for this use since Audacity already knows where clip boundaries are.

    This is a very basic feature.

    Generally speaking, Audacity fails in use cases that involve labelling areas to keep rather than labelling areas to cut during editing (there is for example "Split Delete" but no direct "Split Trim" or whatever you'd call it).

    Problem to be solved

    Removing gaps between clips.

    Prior art

    Literally every application (audio or not) that works with clips of anything has the ability to remove the space between them.

    Additional context

    No response

    I agree this would be a great feature. "Truncate Silence" does not do the job. The workaround is to "Fit Project to Width" and select everything after the gap, cut and paste it closer. But it feels very risky to do this.

  17. d0ugparker commented on Mar 14, 2024

    @d0ugparker

    Mods please consider editing the title to show @SteveDaulton's excellent Nyquist macro plug-in answers the OP's needs.

  18. LWinterberg commented on Oct 6, 2025

    @LWinterberg
    Member

    This won't be needed for Audacity 4 as it has proper ripple editing

  19. moved this from to review (formerly 3.x) to Implemented in Feature Requestson Oct 6, 2025
  20. moved this from Implemented to Replaced by alternative in Feature Requestson Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Enhancement Requestmedium feature

Fields

Priority

None yet

Effort

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions