Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
MixerOptions::ResampleParameters Struct Referencefinal

#include <MixerOptions.h>

Public Member Functions

 ResampleParameters (bool highQuality, double inRate, double outRate, const Warp &options)
 

Public Attributes

bool mHighQuality {}
 
bool mVariableRates { false }
 
double mMinFactor
 
double mMaxFactor
 

Detailed Description

Definition at line 82 of file MixerOptions.h.

Constructor & Destructor Documentation

◆ ResampleParameters()

MixerOptions::ResampleParameters::ResampleParameters ( bool  highQuality,
double  inRate,
double  outRate,
const Warp options 
)

Definition at line 37 of file MixerOptions.cpp.

39 : mHighQuality{ highQuality }
40{
41 double factor = (outRate / inRate);
42 if (const auto envelope = options.envelope) {
43 // variable rate resampling
44 mVariableRates = true;
45 mMinFactor = factor / envelope->GetRangeUpper();
46 mMaxFactor = factor / envelope->GetRangeLower();
47 }
48 else if (options.minSpeed > 0.0 && options.maxSpeed > 0.0) {
49 // variable rate resampling
50 mVariableRates = true;
51 mMinFactor = factor / options.maxSpeed;
52 mMaxFactor = factor / options.minSpeed;
53 }
54 else {
55 // constant rate resampling
56 mVariableRates = false;
57 mMinFactor = factor;
58 mMaxFactor = factor;
59 }
60}

References MixerOptions::Warp::envelope, MixerOptions::Warp::maxSpeed, MixerOptions::Warp::minSpeed, mMaxFactor, mMinFactor, and mVariableRates.

Member Data Documentation

◆ mHighQuality

bool MixerOptions::ResampleParameters::mHighQuality {}

Definition at line 85 of file MixerOptions.h.

Referenced by MixerSource::MakeResamplers().

◆ mMaxFactor

double MixerOptions::ResampleParameters::mMaxFactor

Definition at line 87 of file MixerOptions.h.

Referenced by MixerSource::MakeResamplers(), and ResampleParameters().

◆ mMinFactor

double MixerOptions::ResampleParameters::mMinFactor

Definition at line 87 of file MixerOptions.h.

Referenced by MixerSource::MakeResamplers(), and ResampleParameters().

◆ mVariableRates

bool MixerOptions::ResampleParameters::mVariableRates { false }

The documentation for this struct was generated from the following files: