1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 09:03:54 +01:00

Keyboard scrubbing and Play-at-speed: remove initial silence

Currently AudioIoCallback::ScrubState::Get(), inserts a period of silence the first time it's called because at this time Scrubber::ContinueScrubbingPoll() has not been called, and so message.end has not been set to an appropriate value.
In the case of keyboard scrubbing and play-at-speed, the initial speed is already known, so message.end can be set to this value, removing the need for an initial silence.
The start of keyboard scrubbing and play-at-speed are now faster (the latter very much faster).
This commit is contained in:
David Bailes
2020-02-11 09:54:45 +00:00
parent 55e44cdc83
commit e0302257c5
3 changed files with 27 additions and 16 deletions

View File

@@ -527,6 +527,7 @@ bool Scrubber::StartSpeedPlay(double speed, double time0, double time1)
options.pScrubbingOptions = &mOptions;
options.envelope = nullptr;
mOptions.delay = (ScrubPollInterval_ms / 1000.0);
mOptions.initSpeed = speed;
mOptions.minSpeed = speed -0.01;
mOptions.maxSpeed = speed +0.01;
@@ -602,12 +603,11 @@ bool Scrubber::StartKeyboardScrubbing(double time0, bool backwards)
options.envelope = nullptr;
// delay and minStutterTime are used in AudioIO::AllocateBuffers() for setting the
// values of mPlaybackQueueMinimum and mPlaybackSamplesToCopy respectively. minStutterTime
// is set lower here than in mouse scrubbing to ensure that there is not a long
// delay before the start of the playback of the audio.
// values of mPlaybackQueueMinimum and mPlaybackSamplesToCopy respectively.
mOptions.delay = (ScrubPollInterval_ms / 1000.0);
mOptions.minStutterTime = mOptions.delay;
mOptions.initSpeed = GetKeyboardScrubbingSpeed();
mOptions.minSpeed = ScrubbingOptions::MinAllowedScrubSpeed();
mOptions.maxSpeed = ScrubbingOptions::MaxAllowedScrubSpeed();
mOptions.minTime = 0;