OpenShot Library | libopenshot  0.3.2
Public Member Functions | List of all members
openshot::AudioResampler Class Reference

This class is used to resample audio data for many sequential frames. More...

#include <AudioResampler.h>

Public Member Functions

 AudioResampler (int numChannels=2)
 Default constructor. More...
 
juce::AudioBuffer< float > * GetResampledBuffer ()
 Get the resampled audio buffer. More...
 
void SetBuffer (juce::AudioBuffer< float > *new_buffer, double ratio)
 Sets the audio buffer and key settings. More...
 
void SetBuffer (juce::AudioBuffer< float > *new_buffer, double sample_rate, double new_sample_rate)
 Sets the audio buffer and key settings. More...
 
 ~AudioResampler ()
 Destructor. More...
 

Detailed Description

This class is used to resample audio data for many sequential frames.

It maintains some data from the last call to GetResampledBuffer(), so there are no pops and clicks between frames.

Definition at line 30 of file AudioResampler.h.

Constructor & Destructor Documentation

◆ AudioResampler()

AudioResampler::AudioResampler ( int  numChannels = 2)

Default constructor.

Definition at line 19 of file AudioResampler.cpp.

◆ ~AudioResampler()

AudioResampler::~AudioResampler ( )

Destructor.

Definition at line 48 of file AudioResampler.cpp.

Member Function Documentation

◆ GetResampledBuffer()

juce::AudioBuffer< float > * AudioResampler::GetResampledBuffer ( )

Get the resampled audio buffer.

Definition at line 106 of file AudioResampler.cpp.

◆ SetBuffer() [1/2]

void AudioResampler::SetBuffer ( juce::AudioBuffer< float > *  new_buffer,
double  ratio 
)

Sets the audio buffer and key settings.

Parameters
new_bufferThe buffer of audio samples needing to be resampled
ratioThe multiplier that needs to be applied to the sample rate (this is how resampling happens)

Definition at line 75 of file AudioResampler.cpp.

◆ SetBuffer() [2/2]

void AudioResampler::SetBuffer ( juce::AudioBuffer< float > *  new_buffer,
double  sample_rate,
double  new_sample_rate 
)

Sets the audio buffer and key settings.

Parameters
new_bufferThe buffer of audio samples needing to be resampled
sample_rateThe original sample rate of the buffered samples
new_sample_rateThe requested sample rate you need

Definition at line 60 of file AudioResampler.cpp.


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