VCV Rack API v2
Loading...
Searching...
No Matches
rack::dsp::SampleRateConverter< MAX_CHANNELS > Struct Template Reference

Resamples by a fixed rational factor. More...

#include <resampler.hpp>

Public Member Functions

 SampleRateConverter ()
 
 ~SampleRateConverter ()
 
void setChannels (int channels)
 Sets the number of channels to actually process.
 
void setQuality (int quality)
 From 0 (worst, fastest) to 10 (best, slowest)
 
void setRates (int inRate, int outRate)
 
void refreshState ()
 
void process (const float *in, int inStride, int *inFrames, float *out, int outStride, int *outFrames)
 
void process (const Frame< MAX_CHANNELS > *in, int *inFrames, Frame< MAX_CHANNELS > *out, int *outFrames)
 

Public Attributes

SpeexResamplerState * st = NULL
 
int channels = MAX_CHANNELS
 
int quality = SPEEX_RESAMPLER_QUALITY_DEFAULT
 
int inRate = 44100
 
int outRate = 44100
 

Detailed Description

template<int MAX_CHANNELS>
struct rack::dsp::SampleRateConverter< MAX_CHANNELS >

Resamples by a fixed rational factor.

Constructor & Destructor Documentation

◆ SampleRateConverter()

template<int MAX_CHANNELS>
rack::dsp::SampleRateConverter< MAX_CHANNELS >::SampleRateConverter ( )
inline

◆ ~SampleRateConverter()

template<int MAX_CHANNELS>
rack::dsp::SampleRateConverter< MAX_CHANNELS >::~SampleRateConverter ( )
inline

Member Function Documentation

◆ setChannels()

template<int MAX_CHANNELS>
void rack::dsp::SampleRateConverter< MAX_CHANNELS >::setChannels ( int channels)
inline

Sets the number of channels to actually process.

This can be at most MAX_CHANNELS.

◆ setQuality()

template<int MAX_CHANNELS>
void rack::dsp::SampleRateConverter< MAX_CHANNELS >::setQuality ( int quality)
inline

From 0 (worst, fastest) to 10 (best, slowest)

◆ setRates()

template<int MAX_CHANNELS>
void rack::dsp::SampleRateConverter< MAX_CHANNELS >::setRates ( int inRate,
int outRate )
inline

◆ refreshState()

template<int MAX_CHANNELS>
void rack::dsp::SampleRateConverter< MAX_CHANNELS >::refreshState ( )
inline

◆ process() [1/2]

template<int MAX_CHANNELS>
void rack::dsp::SampleRateConverter< MAX_CHANNELS >::process ( const float * in,
int inStride,
int * inFrames,
float * out,
int outStride,
int * outFrames )
inline

◆ process() [2/2]

template<int MAX_CHANNELS>
void rack::dsp::SampleRateConverter< MAX_CHANNELS >::process ( const Frame< MAX_CHANNELS > * in,
int * inFrames,
Frame< MAX_CHANNELS > * out,
int * outFrames )
inline

Member Data Documentation

◆ st

template<int MAX_CHANNELS>
SpeexResamplerState* rack::dsp::SampleRateConverter< MAX_CHANNELS >::st = NULL

◆ channels

template<int MAX_CHANNELS>
int rack::dsp::SampleRateConverter< MAX_CHANNELS >::channels = MAX_CHANNELS

◆ quality

template<int MAX_CHANNELS>
int rack::dsp::SampleRateConverter< MAX_CHANNELS >::quality = SPEEX_RESAMPLER_QUALITY_DEFAULT

◆ inRate

template<int MAX_CHANNELS>
int rack::dsp::SampleRateConverter< MAX_CHANNELS >::inRate = 44100

◆ outRate

template<int MAX_CHANNELS>
int rack::dsp::SampleRateConverter< MAX_CHANNELS >::outRate = 44100

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