MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
PcmFormatConverter Class Reference

A class that converts samples from one format to another. More...

`#include <FormatConverter.hxx>`

## Public Member Functions
| PcmFormatConverter ()
| ~PcmFormatConverter ()
void | Open (SampleFormat src_format, SampleFormat dest_format)
| Opens the object, prepare for Convert(). More...
void | Close ()
| Closes the object. More...
gcc_pure ConstBuffer< void > | Convert (ConstBuffer< void > src)
| Convert a block of PCM data. More...

## Detailed Description

A class that converts samples from one format to another.

Definition at line 37 of file FormatConverter.hxx.

## Constructor & Destructor Documentation

PcmFormatConverter::PcmFormatConverter | ( |  | ) |
| inline

Definition at line 45 of file FormatConverter.hxx.

PcmFormatConverter::~PcmFormatConverter | ( |  | ) |
| inline

Definition at line 49 of file FormatConverter.hxx.

## Member Function Documentation

void PcmFormatConverter::Close | ( |  | ) |

Closes the object.

After that, you may call Open() again.

gcc_pure ConstBuffer<void> PcmFormatConverter::Convert | ( | ConstBuffer< void > | src | ) |

Convert a block of PCM data.

Throws std::runtime_error on error.

Parameters

  src | the input buffer

Returns
  the destination buffer

void PcmFormatConverter::Open | ( | SampleFormat | src_format,
|  | SampleFormat | dest_format
| ) |  |

Opens the object, prepare for Convert().

Throws std::runtime_error on error.

Parameters

  src_format | the sample format of incoming data
  dest_format | the sample format of outgoing data

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

- pcm/FormatConverter.hxx