Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::audio::PcmDecoder Class Reference

PCM decoder. More...

#include <pcm_decoder.h>

Inheritance diagram for roc::audio::PcmDecoder:
Collaboration diagram for roc::audio::PcmDecoder:

Public Member Functions

 PcmDecoder (const SampleSpec &sample_spec)
 Initialize. More...
 
virtual packet::stream_timestamp_t position () const
 Get current stream position. More...
 
virtual packet::stream_timestamp_t available () const
 Get number of samples available for decoding. More...
 
virtual size_t decoded_sample_count (const void *frame_data, size_t frame_size) const
 Get number of samples per channel, that can be decoded from given frame. More...
 
virtual void begin (packet::stream_timestamp_t frame_position, const void *frame_data, size_t frame_size)
 Start decoding a new frame. More...
 
virtual size_t read (sample_t *samples, size_t n_samples)
 Read samples from current frame. More...
 
virtual size_t shift (size_t n_samples)
 Shift samples from current frame. More...
 
virtual void end ()
 Finish decoding current frame. More...
 

Static Public Member Functions

static IFrameDecoderconstruct (core::IArena &arena, const SampleSpec &sample_spec)
 Construction function. More...
 

Detailed Description

PCM decoder.

Definition at line 24 of file pcm_decoder.h.

Constructor & Destructor Documentation

◆ PcmDecoder()

roc::audio::PcmDecoder::PcmDecoder ( const SampleSpec sample_spec)

Initialize.

Member Function Documentation

◆ available()

virtual packet::stream_timestamp_t roc::audio::PcmDecoder::available ( ) const
virtual

Get number of samples available for decoding.

Implements roc::audio::IFrameDecoder.

◆ begin()

virtual void roc::audio::PcmDecoder::begin ( packet::stream_timestamp_t  frame_position,
const void *  frame_data,
size_t  frame_size 
)
virtual

Start decoding a new frame.

Implements roc::audio::IFrameDecoder.

◆ construct()

static IFrameDecoder* roc::audio::PcmDecoder::construct ( core::IArena arena,
const SampleSpec sample_spec 
)
static

Construction function.

◆ decoded_sample_count()

virtual size_t roc::audio::PcmDecoder::decoded_sample_count ( const void *  frame_data,
size_t  frame_size 
) const
virtual

Get number of samples per channel, that can be decoded from given frame.

Implements roc::audio::IFrameDecoder.

◆ end()

virtual void roc::audio::PcmDecoder::end ( )
virtual

Finish decoding current frame.

Implements roc::audio::IFrameDecoder.

◆ position()

virtual packet::stream_timestamp_t roc::audio::PcmDecoder::position ( ) const
virtual

Get current stream position.

Implements roc::audio::IFrameDecoder.

◆ read()

virtual size_t roc::audio::PcmDecoder::read ( sample_t samples,
size_t  n_samples 
)
virtual

Read samples from current frame.

Implements roc::audio::IFrameDecoder.

◆ shift()

virtual size_t roc::audio::PcmDecoder::shift ( size_t  n_samples)
virtual

Shift samples from current frame.

Implements roc::audio::IFrameDecoder.


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