MPD  0.20.15
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 () noexcept
 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 37 of file FormatConverter.hxx.

Constructor & Destructor Documentation

◆ PcmFormatConverter()

PcmFormatConverter::PcmFormatConverter ( )
inline

Definition at line 45 of file FormatConverter.hxx.

◆ ~PcmFormatConverter()

PcmFormatConverter::~PcmFormatConverter ( )
inline

Definition at line 49 of file FormatConverter.hxx.

Member Function Documentation

◆ Close()

void PcmFormatConverter::Close ( )
noexcept

Closes the object.

After that, you may call Open() again.

◆ Convert()

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

Convert a block of PCM data.

Parameters
srcthe input buffer
Returns
the destination buffer

◆ Open()

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

Opens the object, prepare for Convert().

Throws std::runtime_error on error.

Parameters
src_formatthe sample format of incoming data
dest_formatthe sample format of outgoing data

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