Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1274 - Non-real-time Preview plays incorrect length for 'time-stretch' effects
Non-real-time Preview plays incorrect length for 'time-stretch' effects
Status: RESOLVED FIXED
Product: Audacity
Classification: Unclassified
Component: Built-in FX
2.1.2
Per OS All
: P3 Repeatable
Assigned To: Default Assignee for New Bugs
:
: 1157 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-11 10:20 UTC by Steve Daulton
Modified: 2018-08-20 11:51 UTC (History)
8 users (show)

See Also:
Steps To Reproduce:
Release Note:
GROUP: Effects * '''Preview in "time-stretch" built-in effects plays less than the expected length if the effect increases the length of the selection, or appends silence if the effect reduces the selection length.''' The following effects are affected: Change Tempo, Change Speed, Sliding Time Scale / Pitch Shift, Paulstretch, Repeat and Truncate Silence.
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
stevethefiddle: Regression+
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
gale: Test‑OK‑Lin+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Daulton 2015-12-11 10:20:58 UTC
This bug affects Change Tempo, Change Speed, Sliding Time Scale / Pitch Shift, Paulstretch, Repeat and Truncate Silence.

The expected duration of playback, as set in preferences, is not honoured by effects that change the duration of the selected audio.

Example 1:
Select 1 second of audio and apply "Change Speed" with -90 % change.
With default preferences of 6 seconds preview duration, and 10 seconds of processed audio, the expected result is (approx) 6 seconds of playback. The actual preview playback is currently 1 second.

Example 2:
Select 30 seconds of audio and apply "Change Speed" with +200% change.
With default preferences of 6 seconds preview duration, and 10 seconds of processed audio, the expected result is (approx) 6 seconds of playback. The actual preview playback is currently about 6 seconds of sound followed by 12 seconds of silence.

The problem in "Truncate Silence" will probably need to be handled as a separate bug because the "stretched" duration cannot be predicted before processing.

Most of the problem can be resolved by setting t1 = mT1 after calling Process() in Preview() in Effect.cpp. (proposed by Clayton Otey). There will be some residual issues, specifically for Paulstretch (which does not currently call CalcPreviewInputLength), and for Truncate Silence (for which the output duration cannot be calculated prior to processing).

Initially marked as P3 (suggested by Gale).
Comment 1 Gale Andrews 2015-12-11 15:09:45 UTC
Release note added.
Comment 2 Gale Andrews 2015-12-11 15:10:21 UTC
*** Bug 1157 has been marked as a duplicate of this bug. ***
Comment 3 Steve Daulton 2015-12-12 10:48:32 UTC
As a minor variation to Clayton's proposed fix, I propose:

After calling Process() in Preview() in Effect.cpp
t1 = std::min(mT0 + previewLen, mT1);

This fixes this bug for Change Tempo, Change Speed, and Repeat.

Additional work is required to fix Truncate Silence, Sliding Time Scale and Paulstretch, but Truncate Silence and Paulstretch can then be easily "fixed" so that they produce the correct preview, though additional work will still be required for an optimal fix for these two effects. The remaining issues for Sliding Time Scale are being addressed by Clayton (bug 955).
Comment 4 Gale Andrews 2015-12-12 16:36:27 UTC
Clayton requested this bug to block bug 955 (done). After Steve's fix or similar is committed the block would be removed and then this bug would depend on 955 as per the summary title and release note for bug 1274.
Comment 5 Steve Daulton 2016-01-20 16:38:51 UTC
Should be fixed by https://github.com/audacity/audacity/commit/46055cde
Comment 6 Steve Daulton 2016-01-20 16:40:44 UTC
Removed block on bug 955.
Comment 7 Peter Sampson 2016-01-23 09:37:27 UTC
I tested both of Steve's Use Case Examples on W10 on audacity-win-r376fc0e-2.1.3-alpha-22-jan-16

Both yield the "expected reselt" that Steve detailed.
Comment 8 Peter Sampson 2016-11-01 09:39:00 UTC
(In reply to Steve Daulton from comment #5)
Testing on Mac Sierra ccbee2 31Oct16

Both of Steve's example in his orriginal post now play the correct 6 seconds on Mac on macOS Sierra
Comment 9 Gale Andrews 2016-12-20 19:03:06 UTC
I tested the effects not tested by Peter on Windows 10 at 12 seconds preview. This was OK as well as the two Change Speed examples given by Steve on Ubuntu 14.04.