You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Truncate Silence" fails to work on any gaps between Clips #3988
Looks like the behaviour of truncate silence has always depended on the setting preferences > track behaviors > editing a clip can move other clips. Since this setting has been disabled by default, then with default settings, the behaviour of truncate silence is as described in this issue.
Looks like the behaviour of truncate silence has always depended on the setting preferences > track behaviors > editing a clip can move other clips. Since this setting has been disabled by default, then with default settings, the behaviour of truncate silence is as described in this issue.
@DavidBailes I will later add a note to the Truncate Silence page of the Manual warning the reader about this.
Truncate Silence is moved to Edit > Remove Special
That may be easier for people to find (now that it is no longer visible by default in the Effect menu), but technically "Truncate Silence" is an "Effect" (it processes the selected audio) rather than an "Edit". While this may seem a bit pedantic, there are some important differences in how effects behave compared to edits, for example when applied to a 16-bit track, an effect will resample the audio to 32-bit float and back to 16-bit (with dither by default), whereas edits do not modify the underlying data.
2. A new option is added to Edit > Audio Clips called "Remove Gaps" which removes gaps between clips (
I'm not a fan of duplicating functionality unless it is adding a new, unique benefit. As was (imo) previously the case with so many ways to zoom in and out, duplicate functionality increases clutter.
3. Truncate Silence is given permission to move clips around again if clips live within its selection
I'm not a fan of duplicating functionality unless it is adding a new, unique benefit.
The unique benefit would be that you could truncate silences between gaps while leaving the clips themselves intact with any silences that may be in them.
The unique benefit would be that you could truncate silences between gaps while leaving the clips themselves intact with any silences that may be in them.
Considering that can be done more easily than ever now that clips have drag bars (drag handles), what's the common use case that makes it worth developing and adding as a built-in rather than an optional plug-in? (It could be done with a Nyquist Macro).
The unique benefit would be that you could truncate silences between gaps while leaving the clips themselves intact with any silences that may be in them.
Truncate Silence does not leave the clips intact if there's silence within them.
That's right, but it looks like quite a fringe case. Even the example you gave above can be handled by Truncate Silence (by setting the "Detect Silence > Duration" greater than the flat line silences).
It could be done with a Nyquist Macro
I've had a look at this, and yes it can be done, though handling all possible edge cases gets a bit messy. I'm not convinced that there's sufficient demand to justify the development effort even for a Nyquist plug-in (developing in Nyquist is much quicker than C++)
@DavidBailes I will later add a note to the Truncate Silence page of the Manual warning the reader about this.
I have added an advice div to the Truncate Silence page in the 3.2.2 alpha Manual for this., I added a P2 for the removal of that ednote for if and when this issue gets fixed:
Note that even if Editing a clip can move other clips is in it's default off setting then subsequent clips do not honor the off setting and can get moved regardless if the preceding clip has "silence" in it that gets deleted by the effect.
Before
After
Note carefully that using Delete to remove the silence does honor the "off" setting
I have been thinking about this and it troubles me phiosophically and semantically that we are dealing with two different entities here:
true "silence" flat line (or aproximately close) within a clip
''Gaps" between clips which play and get rendered as silence BUT which are NOT actually true silence
So maybe Truncate Silence should have an option added to its dialog for: Treat inter-Clip gaps as silence
a) I'm not sure whether that should be defaulted "on" or "off" - possibly "on" would be the better choice
b) It does not remove any of the discussions in this thread with regard to actions of Truncate Silence on the basis of the Editing a clip can move other clips setting.
Mystery-Shopper reaction
I did discuss this with my "Mystery-Shopper" and she was most definite that the gap is not the same thing as the silence
That may be easier for people to find (now that it is no longer visible by default in the Effect menu), but technically "Truncate Silence" is an "Effect" (it processes the selected audio) rather than an "Edit". While this may seem a bit pedantic, there are some important differences in how effects behave compared to edits, for example when applied to a 16-bit track, an effect will resample the audio to 32-bit float and back to 16-bit (with dither by default), whereas edits do not modify the underlying data.
This is a "tail wagging the dog" approach. Menu structures should be made to meet the user expectations, not because of technicalities. Whether or not something might resample the track before execution certainly is not the guiding principle in finding a tool, and even if a user cares about resampling at all, surely the solution is to make truncate silence to not resample the track. Given that both trimming, silencing, splitting and joining are available from the edit menu, it's definitely possible.
So maybe Truncate Silence should have an option added to its dialog for: Treat inter-Clip gaps as silence
I mocked up adding such an option to the truncate silence dialog, but it turns an already confusing dialog even more confusing: It would require a tri-state toggle (truncate silence only, truncate gaps only, truncate silence and gaps), where the dB threshold wouldn't have any effect on the gaps. The dialog already is quite cluttered for what it does, and if you do just want to move all clips in the project back-to-back, it creates massive cognitive load for what could be a dialog-free one-click operation.
Menu structures should be made to meet the user expectations
Expectations may differ according to knowledge and experience, but I do see your point. "Silence Audio" in the Edit menu is technically an effect (generator), but everyone (including myself) seems to be happy with that. I'm just suggesting caution about implementing things in ways that are not technically correct.
surely the solution is to make truncate silence to not resample the track
Processing in Audacity is always done with 32-bit float data. Changing that would likely be a huge refactoring task with hardly any tangible benefits.
It could be done by rewriting Truncate Silence as an actual "edit" operation, but then it would frequently create clicks at the edit points.
Personally I think the best solution would be:
Fix the current issue with Truncate Silence changing the selection differently from the actual length reduction.
Add a new Edit menu command to remove gaps between selected clips ("Remove Gaps"?).
(It may be a good idea to decide how / if Audacity will handle stereo clips that have different start / end times before developing this new command).
In Truncate Silence, remove the -80dB limit for the threshold level, or at least allow it to be set much lower.
(The reason that it has a -80 dB limit is historic - The effect was originally developed by Lynn Allan in 2007 with the dB level set by a multi-choice menu. The downside of the multi-choice menu was that the number of options has to be limited, but the advantage was that the final option was "Off-Skip" (equivalent to -inf dB). Ideally it would be a true logarithmic slider with a range -inf to 0dB, but Audacity does not currently have a widget like that.)
Add a new Edit menu command to remove gaps between selected clips ("Remove Gaps"?).
That sound like a good idea.
and then
Truncate Silence could/should be made to work just on true "silences" within clips - and should properly honor the setting for Editing a clip can move other clips by only moving clips when this is set on.
Another really odd behavior is that if you turn on the Editing a clip can move other clips and then turn it off again the the "off" setting gets ignored.
clear Audacity settings folder
generate a thirty second chirp
split it at 15 seconds
move the second clip to the right
Edit > Preferences >Tracks Behaviors
Observe: Editing a clip can move other clips is "off" - default setting
select all
Truncate Silence
Observe: nothing happens
Edit > Preferences >Tracks Behaviors
Turn Editing a clip can move other clips "on"
select all
Truncate Silence
Observe: the inter-clip gap is removed
Undo
Edit > Preferences >Tracks Behaviors
Turn Editing a clip can move other clips "off"
select all
Truncate Silence
Observe: the inter-clip gap is removed
But at step 20 I would expect the same behavior as at Steps 8-9 - as we now have the "off" setting so clips should not move.
Another really odd behavior is that if you turn on the Editing a clip can move other clips and then turn it off again the the "off" setting gets ignored.
I ran into this really confusing bug a short time ago, and I've logged it: #3998
Activity
SteveDaulton commentedon Nov 27, 2022
Also happens in 3.2.1 with default Preferences.
DavidBailes commentedon Nov 28, 2022
Looks like the behaviour of truncate silence has always depended on the setting preferences > track behaviors > editing a clip can move other clips. Since this setting has been disabled by default, then with default settings, the behaviour of truncate silence is as described in this issue.
petersampsonaudacity commentedon Nov 28, 2022
The other fundamental issue is that gaps between audio are not true Audacity "Silence" - if they were they would show as a flat line,
They can be rendered to silence of course.
petersampsonaudacity commentedon Nov 28, 2022
It also leads to this rather odd effect of changing the selection as though the pseudo-silence gap had been removed:
Before Truncate Silence with default settings
After Truncate Silence with default settings
petersampsonaudacity commentedon Nov 28, 2022
Testing this also begs another question about a (to me somewhat odd) design decision.
Just why is the default "Truncate to" set to be 0.5 seconds? Surely most users who want silence truncated want it truncated to zero?

SteveDaulton commentedon Nov 28, 2022
I believe that was chosen for reducing pauses in speech recordings. (Very handy for listening to lecture notes when there may be long pauses).
petersampsonaudacity commentedon Nov 28, 2022
@DavidBailes I will later add a note to the Truncate Silence page of the Manual warning the reader about this.
LWinterberg commentedon Nov 28, 2022
How about this:
SteveDaulton commentedon Nov 28, 2022
That may be easier for people to find (now that it is no longer visible by default in the Effect menu), but technically "Truncate Silence" is an "Effect" (it processes the selected audio) rather than an "Edit". While this may seem a bit pedantic, there are some important differences in how effects behave compared to edits, for example when applied to a 16-bit track, an effect will resample the audio to 32-bit float and back to 16-bit (with dither by default), whereas edits do not modify the underlying data.
I'm not a fan of duplicating functionality unless it is adding a new, unique benefit. As was (imo) previously the case with so many ways to zoom in and out, duplicate functionality increases clutter.
I think that's the correct solution.
LWinterberg commentedon Nov 28, 2022
The unique benefit would be that you could truncate silences between gaps while leaving the clips themselves intact with any silences that may be in them.
SteveDaulton commentedon Nov 28, 2022
Considering that can be done more easily than ever now that clips have drag bars (drag handles), what's the common use case that makes it worth developing and adding as a built-in rather than an optional plug-in? (It could be done with a Nyquist Macro).
petersampsonaudacity commentedon Nov 28, 2022
That already happens with Edit > Truncate Silence
Before
After
2 remaining items
SteveDaulton commentedon Nov 28, 2022
That's right, but it looks like quite a fringe case. Even the example you gave above can be handled by Truncate Silence (by setting the "Detect Silence > Duration" greater than the flat line silences).
I've had a look at this, and yes it can be done, though handling all possible edge cases gets a bit messy. I'm not convinced that there's sufficient demand to justify the development effort even for a Nyquist plug-in (developing in Nyquist is much quicker than C++)
petersampsonaudacity commentedon Nov 28, 2022
Nor should it, as the silences in you example are part of the two clips.
petersampsonaudacity commentedon Nov 29, 2022
I have added an advice div to the Truncate Silence page in the 3.2.2 alpha Manual for this., I added a P2 for the removal of that ednote for if and when this issue gets fixed:
[-]"Truncate Silence" fails[/-][+]"Truncate Silence" fails to work on any gaps between Clips[/+]petersampsonaudacity commentedon Nov 29, 2022
Note that even if Editing a clip can move other clips is in it's default off setting then subsequent clips do not honor the off setting and can get moved regardless if the preceding clip has "silence" in it that gets deleted by the effect.
Before
After
Note carefully that using Delete to remove the silence does honor the "off" setting
petersampsonaudacity commentedon Nov 29, 2022
I have been thinking about this and it troubles me phiosophically and semantically that we are dealing with two different entities here:
So maybe Truncate Silence should have an option added to its dialog for: Treat inter-Clip gaps as silence
a) I'm not sure whether that should be defaulted "on" or "off" - possibly "on" would be the better choice
b) It does not remove any of the discussions in this thread with regard to actions of Truncate Silence on the basis of the Editing a clip can move other clips setting.
Mystery-Shopper reaction
I did discuss this with my "Mystery-Shopper" and she was most definite that the gap is not the same thing as the silence
LWinterberg commentedon Nov 30, 2022
This is a "tail wagging the dog" approach. Menu structures should be made to meet the user expectations, not because of technicalities. Whether or not something might resample the track before execution certainly is not the guiding principle in finding a tool, and even if a user cares about resampling at all, surely the solution is to make truncate silence to not resample the track. Given that both trimming, silencing, splitting and joining are available from the edit menu, it's definitely possible.
I mocked up adding such an option to the truncate silence dialog, but it turns an already confusing dialog even more confusing: It would require a tri-state toggle (truncate silence only, truncate gaps only, truncate silence and gaps), where the dB threshold wouldn't have any effect on the gaps. The dialog already is quite cluttered for what it does, and if you do just want to move all clips in the project back-to-back, it creates massive cognitive load for what could be a dialog-free one-click operation.
SteveDaulton commentedon Nov 30, 2022
Expectations may differ according to knowledge and experience, but I do see your point. "Silence Audio" in the Edit menu is technically an effect (generator), but everyone (including myself) seems to be happy with that. I'm just suggesting caution about implementing things in ways that are not technically correct.
Processing in Audacity is always done with 32-bit float data. Changing that would likely be a huge refactoring task with hardly any tangible benefits.
It could be done by rewriting Truncate Silence as an actual "edit" operation, but then it would frequently create clicks at the edit points.
Personally I think the best solution would be:
(It may be a good idea to decide how / if Audacity will handle stereo clips that have different start / end times before developing this new command).
(The reason that it has a -80 dB limit is historic - The effect was originally developed by Lynn Allan in 2007 with the dB level set by a multi-choice menu. The downside of the multi-choice menu was that the number of options has to be limited, but the advantage was that the final option was "Off-Skip" (equivalent to -inf dB). Ideally it would be a true logarithmic slider with a range -inf to 0dB, but Audacity does not currently have a widget like that.)
petersampsonaudacity commentedon Nov 30, 2022
That sound like a good idea.
and then
petersampsonaudacity commentedon Nov 30, 2022
Another really odd behavior is that if you turn on the Editing a clip can move other clips and then turn it off again the the "off" setting gets ignored.
But at step 20 I would expect the same behavior as at Steps 8-9 - as we now have the "off" setting so clips should not move.
DavidBailes commentedon Nov 30, 2022
I ran into this really confusing bug a short time ago, and I've logged it: #3998
DavidBailes commentedon Dec 1, 2022
And as I've commented on that issue, other settings have the same bug.