MPD: LibsampleratePcmResampler Class Reference

MPD 0.20.18

Public Member Functions
LibsampleratePcmResampler Class Referencefinal

A resampler using libsamplerate. More...

`#include <LibsamplerateResampler.hxx>`

Inheritance diagram for LibsampleratePcmResampler:
[legend]
Collaboration diagram for LibsampleratePcmResampler:
[legend]

## Public Member Functions
AudioFormat | Open (AudioFormat &af, unsigned new_sample_rate) override
| Opens the resampler, preparing it for Resample(). More...
void | Close () override
| Closes the resampler. More...
void | Reset () override
| Reset the filter's state, e.g. More...
ConstBuffer< void > | Resample (ConstBuffer< void > src) override
| Resamples a block of PCM data. More...
Public Member Functions inherited from PcmResampler
virtual | ~PcmResampler ()

## Detailed Description

A resampler using libsamplerate.

Definition at line 35 of file LibsamplerateResampler.hxx.

## Member Function Documentation

## ◆ Close()

void LibsampleratePcmResampler::Close | ( |  | ) |
| overridevirtual

Closes the resampler.

After that, you may call Open() again.

Implements PcmResampler.

## ◆ Open()

AudioFormat LibsampleratePcmResampler::Open | ( | AudioFormat & | af,
|  | unsigned | new_sample_rate
| ) |  |
| overridevirtual

Opens the resampler, preparing it for Resample().

Throws std::runtime_error on error.

Parameters

  af | the audio format of incoming data; the plugin may modify the object to enforce another input format (however, it may not request a different input sample rate)
  new_sample_rate | the requested output sample rate
  error | location to store the error

Returns
  the format of outgoing data

Implements PcmResampler.

## ◆ Resample()

ConstBuffer<void> LibsampleratePcmResampler::Resample | ( | ConstBuffer< void > | src | ) |
| overridevirtual

Resamples a block of PCM data.

Throws std::runtime_error on error.

Parameters

  src | the input buffer

Returns
  the destination buffer (will be invalidated by filter_close() or filter_filter())

Implements PcmResampler.

## ◆ Reset()

void LibsampleratePcmResampler::Reset | ( |  | ) |
| overridevirtual

Reset the filter's state, e.g.

drop/flush buffers.

Reimplemented from PcmResampler.

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

- pcm/LibsamplerateResampler.hxx