MPD: PcmChannelsConverter Class Reference

MPD 0.20.18

Public Member Functions
PcmChannelsConverter Class Reference

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

`#include <ChannelsConverter.hxx>`

## Public Member Functions
| PcmChannelsConverter ()
| ~PcmChannelsConverter ()
void | Open (SampleFormat format, unsigned src_channels, unsigned dest_channels)
| Opens the object, prepare for Convert(). More...
void | Close ()
| Closes the object. More...
gcc_pure ConstBuffer< void > | Convert (ConstBuffer< void > src) noexcept
| Convert a block of PCM data. More...

## Detailed Description

A class that converts samples from one format to another.

Definition at line 36 of file ChannelsConverter.hxx.

## Constructor & Destructor Documentation

## ◆ PcmChannelsConverter()

PcmChannelsConverter::PcmChannelsConverter | ( |  | ) |
| inline

Definition at line 44 of file ChannelsConverter.hxx.

## ◆ ~PcmChannelsConverter()

PcmChannelsConverter::~PcmChannelsConverter | ( |  | ) |
| inline

Definition at line 47 of file ChannelsConverter.hxx.

## Member Function Documentation

## ◆ Close()

void PcmChannelsConverter::Close | ( |  | ) |

Closes the object.

After that, you may call Open() again.

## ◆ Convert()

gcc_pure ConstBuffer<void> PcmChannelsConverter::Convert | ( | ConstBuffer< void > | src | ) |
| noexcept

Convert a block of PCM data.

Throws std::runtime_error on error.

Parameters

  src | the input buffer

Returns
  the destination buffer

## ◆ Open()

void PcmChannelsConverter::Open | ( | SampleFormat | format,
|  | unsigned | src_channels,
|  | unsigned | dest_channels
| ) |  |

Opens the object, prepare for Convert().

Throws std::runtime_error on error.

Parameters

  format | the sample format
  src_channels | the number of source channels
  dest_channels | the number of destination channels

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

- pcm/ChannelsConverter.hxx