openshot::AudioResampler Class Reference

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

`#include <AudioResampler.h>`

## Public Member Functions

| AudioResampler ()
| Default constructor. More...
AudioSampleBuffer * | GetResampledBuffer ()
| Get the resampled audio buffer. More...
void | SetBuffer (AudioSampleBuffer *new_buffer, double ratio)
| Sets the audio buffer and key settings. More...
void | SetBuffer (AudioSampleBuffer *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 53 of file AudioResampler.h.

## Constructor & Destructor Documentation

## AudioResampler()

AudioResampler::AudioResampler | ( |  | ) |

Default constructor.

Definition at line 34 of file AudioResampler.cpp.

## ~AudioResampler()

AudioResampler::~AudioResampler | ( |  | ) |

Destructor.

Definition at line 62 of file AudioResampler.cpp.

## Member Function Documentation

## GetResampledBuffer()

AudioSampleBuffer * AudioResampler::GetResampledBuffer | ( |  | ) |

Get the resampled audio buffer.

Definition at line 120 of file AudioResampler.cpp.

## SetBuffer() [1/2]

void AudioResampler::SetBuffer | ( | AudioSampleBuffer * | new_buffer,
|  | double | ratio
| ) |  |

Sets the audio buffer and key settings.

Parameters

  new_buffer | The buffer of audio samples needing to be resampled
  ratio | The multiplier that needs to be applied to the sample rate (this is how resampling happens)

Definition at line 89 of file AudioResampler.cpp.

## SetBuffer() [2/2]

void AudioResampler::SetBuffer | ( | AudioSampleBuffer * | new_buffer,
|  | double | sample_rate,
|  | double | new_sample_rate
| ) |  |

Sets the audio buffer and key settings.

Parameters

  new_buffer | The buffer of audio samples needing to be resampled
  sample_rate | The original sample rate of the buffered samples
  new_sample_rate | The requested sample rate you need

Definition at line 74 of file AudioResampler.cpp.

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

- AudioResampler.h
- AudioResampler.cpp