37 durationToDiscard * clip.
GetRate() + .5 };
45 clip, durationToDiscard) }
46 , mSource { clip, durationToDiscard, direction }
47 , mPreserveFormants { clip.GetPitchAndSpeedPreset() ==
49 , mCentShift { clip.GetCentShift() }
51 clip.
GetRate(), clip.NChannels(), mSource,
53 , mOnSemitoneShiftChangeSubscription { clip.SubscribeToCentShiftChange(
58 , mOnFormantPreservationChangeSubscription {
63 mUpdateFormantPreservation =
true;
90 mStretcher->GetSamples(buffers, numSamplesToProduce);
92 return numSamplesToProduce;
EffectDistortionSettings params
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
virtual int GetCentShift() const =0
virtual PitchAndSpeedPreset GetPitchAndSpeedPreset() const =0
virtual Observer::Subscription SubscribeToPitchAndSpeedPresetChange(std::function< void(PitchAndSpeedPreset)> cb) const =0
size_t NChannels() const override
The number of channels in the segment.
Observer::Subscription mOnSemitoneShiftChangeSubscription
ClipTimeAndPitchSource mSource
ClipSegment(const ClipInterface &, double durationToDiscard, PlaybackDirection)
sampleCount mTotalNumSamplesProduced
std::unique_ptr< TimeAndPitchInterface > mStretcher
Observer::Subscription mOnFormantPreservationChangeSubscription
size_t GetFloats(float *const *buffers, size_t numSamples) override
Fills buffers with as many as numSamples or the number of remaining samples, whichever is smaller.
bool Empty() const override
Whether the segment has no more samples to provide.
std::atomic< bool > mUpdateCentShift
std::atomic< bool > mUpdateFormantPreservation
const sampleCount mTotalNumSamplesToProduce
virtual int GetRate() const =0
virtual double GetStretchRatio() const =0
virtual sampleCount GetVisibleSampleCount() const =0
void Reset() noexcept
Breaks the connection (constant time)
Positions or offsets within audio files need a wide type.
TimeAndPitchInterface::Parameters GetStretchingParameters(const ClipInterface &clip)
sampleCount GetTotalNumSamplesToProduce(const ClipInterface &clip, double durationToDiscard)
double GetRate(const Track &track)