Audacity 3.2.0
Functions
anonymous_namespace{ClipSegment.cpp} Namespace Reference

Functions

TimeAndPitchInterface::Parameters GetStretchingParameters (const ClipInterface &clip)
 
sampleCount GetTotalNumSamplesToProduce (const ClipInterface &clip, double durationToDiscard)
 

Detailed Description


Audacity: A Digital Audio Editor

ClipSegment.cpp

Matthieu Hodgkinson

Function Documentation

◆ GetStretchingParameters()

TimeAndPitchInterface::Parameters anonymous_namespace{ClipSegment.cpp}::GetStretchingParameters ( const ClipInterface clip)

Definition at line 22 of file ClipSegment.cpp.

23{
25 params.timeRatio = clip.GetStretchRatio();
26 params.pitchRatio = std::pow(2., clip.GetCentShift() / 1200.);
27 params.preserveFormants =
29 return params;
30}
EffectDistortionSettings params
virtual int GetCentShift() const =0
virtual PitchAndSpeedPreset GetPitchAndSpeedPreset() const =0
virtual double GetStretchRatio() const =0

References ClipInterface::GetCentShift(), ClipInterface::GetPitchAndSpeedPreset(), ClipTimes::GetStretchRatio(), OptimizeForVoice, and params.

Here is the call graph for this function:

◆ GetTotalNumSamplesToProduce()

sampleCount anonymous_namespace{ClipSegment.cpp}::GetTotalNumSamplesToProduce ( const ClipInterface clip,
double  durationToDiscard 
)

Definition at line 33 of file ClipSegment.cpp.

34{
36 clip.GetStretchRatio() -
37 durationToDiscard * clip.GetRate() + .5 };
38}
virtual int GetRate() const =0
virtual sampleCount GetVisibleSampleCount() const =0
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
double as_double() const
Definition: SampleCount.h:46

References sampleCount::as_double(), ClipTimes::GetRate(), ClipTimes::GetStretchRatio(), and ClipTimes::GetVisibleSampleCount().

Here is the call graph for this function: