MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
PcmResampler Class Referenceabstract

This is an interface for plugins that convert PCM data to a specific sample rate. More...

`#include <Resampler.hxx>`

Inheritance diagram for PcmResampler:
[legend]

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

## Detailed Description

This is an interface for plugins that convert PCM data to a specific sample rate.

Definition at line 32 of file Resampler.hxx.

## Constructor & Destructor Documentation

virtual PcmResampler::~PcmResampler | ( |  | ) |
| inline virtual

Definition at line 34 of file Resampler.hxx.

## Member Function Documentation

virtual void PcmResampler::Close | ( |  | ) |
| pure virtual

Closes the resampler.

After that, you may call Open() again.

Implemented in LibsampleratePcmResampler, SoxrPcmResampler, and FallbackPcmResampler.

virtual AudioFormat PcmResampler::Open | ( | AudioFormat & | af,
|  | unsigned | new_sample_rate
| ) |  |
| pure virtual

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

Implemented in LibsampleratePcmResampler, SoxrPcmResampler, and FallbackPcmResampler.

virtual gcc_pure ConstBuffer<void> PcmResampler::Resample | ( | ConstBuffer< void > | src | ) |
| pure virtual

Resamples a block of PCM data.

Parameters

  src | the input buffer

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

Implemented in LibsampleratePcmResampler, SoxrPcmResampler, and FallbackPcmResampler.

virtual void PcmResampler::Reset | ( |  | ) |
| inline virtual

Reset the filter's state, e.g.

drop/flush buffers.

Reimplemented in LibsampleratePcmResampler.

Definition at line 60 of file Resampler.hxx.

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

- pcm/Resampler.hxx