arduino-audio-tools
Loading...
Searching...
No Matches
OggVorbisDecoder Class Reference

Ogg Vorbis Decoder. More...

#include <OggVorbisDecoder.h>

Inheritance diagram for OggVorbisDecoder:
OggContainerDecoder ContainerDecoder AudioDecoder AudioDecoder AudioInfoSource AudioWriter AudioInfoSource AudioWriter AudioInfoSource AudioWriter AudioInfoSource AudioWriter

Public Member Functions

 OggVorbisDecoder ()
 Constructor for OggVorbisDecoder Initializes the decoder and sets the underlying VorbisDecoder.
virtual void addNotifyAudioChange (AudioInfoSupport &bi)
 Adds target to be notified about audio changes.
void addNotifyAudioChange (AudioInfoSupport &bi) override
AudioInfo audioInfo () override
 provides the actual input AudioInfo
virtual AudioInfo audioInfoOut ()
virtual AudioInfo audioInfoOut ()
virtual bool begin (AudioInfo info) override
bool begin () override
bool begin (AudioInfo info) override
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
virtual void clearNotifyAudioChange ()
 Deletes all change notify subscriptions.
void end () override
void flush ()
Print * getOutput ()
Print * getOutput ()
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
bool isNotifyActive ()
 Checks if the automatic AudioInfo update is active.
const char * mime () override
 Provides the mime type of the wrapped codec (default: CopyDecoder's).
virtual operator bool () override
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
virtual bool removeNotifyAudioChange (AudioInfoSupport &bi)
 Removes a target in order not to be notified about audio changes.
void setAudioInfo (AudioInfo from) override
 for most decoders this is not needed
void setAudioInfo (AudioInfo from) override
 for most decoders this is not needed
virtual bool setCodecConfig (const uint8_t *data, size_t len)
 Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
virtual bool setCodecConfig (const uint8_t *data, size_t len)
 Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
void setDecoder (AudioDecoder *decoder)
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active).
void setNotifyActive (bool flag)
 Deactivate/Reactivate automatic AudioInfo updates: (default is active).
virtual void setOutput (AudioOutput &out_stream)
 Defines where the decoded result is written to.
virtual void setOutput (AudioStream &out_stream)
 Defines where the decoded result is written to.
void setOutput (Print &print) override
 Defines the output Stream.
virtual size_t write (const uint8_t *data, size_t len) override

Public Attributes

int id
 custom id to be used by application

Protected Member Functions

virtual void beginOfSegment (ogg_packet *op)
virtual void endOfSegment (ogg_packet *op)
void notifyAudioChange (AudioInfo info)
void notifyAudioChange (AudioInfo info)
void writeBlocking (Print *out, uint8_t *data, size_t len)
void writeBlocking (Print *out, uint8_t *data, size_t len)

Static Protected Member Functions

static size_t ogg_io_read (void *user_handle, void *buf, size_t n)
static int read_packet (OGGZ *oggz, oggz_packet *zp, long serialno, void *user_data)
static int read_page (OGGZ *oggz, const ogg_page *og, long serialno, void *user_data)

Protected Attributes

RingBuffer< uint8_t > buffer { ( (1024) )}
CopyDecoder dec_copy
AudioInfo info
bool is_notify_active = true
bool is_open = false
Vector< AudioInfoSupport * > notify_vector
EncodedAudioOutput out
AudioDecoder * p_codec = nullptr
OGGZ * p_oggz = nullptr
Print * p_print = nullptr
long pos = 0
VorbisDecoder vorbis
 Underlying Vorbis decoder.

Detailed Description

Ogg Vorbis Decoder.

This class wraps VorbisDecoder in an Ogg container decoder, allowing decoding of Ogg Vorbis streams with automatic packet extraction.

Usage:

  1. Instantiate OggVorbisDecoder.
  2. Feed Ogg Vorbis data to the decoder.
  3. PCM output is provided via the underlying VorbisDecoder.
Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ OggVorbisDecoder()

OggVorbisDecoder ( )
inline

Constructor for OggVorbisDecoder Initializes the decoder and sets the underlying VorbisDecoder.

Member Function Documentation

◆ addNotifyAudioChange() [1/2]

virtual void addNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Adds target to be notified about audio changes.

Reimplemented in CodecNOP, CodecNOP, EncodedAudioOutput, and EncodedAudioStream.

◆ addNotifyAudioChange() [2/2]

void addNotifyAudioChange ( AudioInfoSupport & bi)
inlineoverrideinherited

◆ audioInfo()

AudioInfo audioInfo ( )
inlineoverridevirtualinherited

provides the actual input AudioInfo

Reimplemented from AudioDecoder.

◆ audioInfoOut() [1/2]

◆ audioInfoOut() [2/2]

◆ begin() [1/3]

virtual bool begin ( AudioInfo info)
inlineoverridevirtualinherited

Reimplemented from AudioWriter.

◆ begin() [2/3]

bool begin ( )
inlineoverridevirtualinherited

Reimplemented from AudioDecoder.

Reimplemented in OpusOggDecoder.

◆ begin() [3/3]

bool begin ( AudioInfo info)
inlineoverrideinherited

◆ beginOfSegment()

virtual void beginOfSegment ( ogg_packet * op)
inlineprotectedvirtualinherited

Reimplemented in OpusOggDecoder.

◆ clearNotifyAudioChange() [1/2]

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

◆ clearNotifyAudioChange() [2/2]

virtual void clearNotifyAudioChange ( )
inlinevirtualinherited

◆ end()

void end ( )
inlineoverridevirtualinherited

Reimplemented from AudioDecoder.

Reimplemented in OpusOggDecoder.

◆ endOfSegment()

virtual void endOfSegment ( ogg_packet * op)
inlineprotectedvirtualinherited

◆ flush()

void flush ( )
inlineinherited

◆ getOutput() [1/2]

Print * getOutput ( )
inlineinherited

◆ getOutput() [2/2]

Print * getOutput ( )
inlineinherited

◆ isNotifyActive() [1/2]

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ isNotifyActive() [2/2]

bool isNotifyActive ( )
inlineinherited

Checks if the automatic AudioInfo update is active.

◆ mime()

const char * mime ( )
inlineoverridevirtualinherited

Provides the mime type of the wrapped codec (default: CopyDecoder's).

Implements AudioDecoder.

◆ notifyAudioChange() [1/2]

void notifyAudioChange ( AudioInfo info)
inlineprotectedinherited

◆ notifyAudioChange() [2/2]

void notifyAudioChange ( AudioInfo info)
inlineprotectedinherited

◆ ogg_io_read()

size_t ogg_io_read ( void * user_handle,
void * buf,
size_t n )
inlinestaticprotectedinherited

◆ operator bool()

virtual operator bool ( )
inlineoverridevirtualinherited

Implements AudioWriter.

◆ read_packet()

int read_packet ( OGGZ * oggz,
oggz_packet * zp,
long serialno,
void * user_data )
inlinestaticprotectedinherited

◆ read_page()

int read_page ( OGGZ * oggz,
const ogg_page * og,
long serialno,
void * user_data )
inlinestaticprotectedinherited

◆ removeNotifyAudioChange() [1/2]

virtual bool removeNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

◆ removeNotifyAudioChange() [2/2]

virtual bool removeNotifyAudioChange ( AudioInfoSupport & bi)
inlinevirtualinherited

Removes a target in order not to be notified about audio changes.

◆ setAudioInfo() [1/2]

void setAudioInfo ( AudioInfo from)
inlineoverridevirtualinherited

for most decoders this is not needed

Implements AudioWriter.

Reimplemented in CodecNOP, and CodecNOP.

◆ setAudioInfo() [2/2]

void setAudioInfo ( AudioInfo from)
inlineoverridevirtualinherited

for most decoders this is not needed

Implements AudioWriter.

Reimplemented in CodecNOP, and CodecNOP.

◆ setCodecConfig() [1/2]

virtual bool setCodecConfig ( const uint8_t * data,
size_t len )
inlinevirtualinherited

Some decoders need e.g. a magic cookie to provide the relevant info for decoding.

Reimplemented in DecoderALAC, and MultiDecoder.

◆ setCodecConfig() [2/2]

virtual bool setCodecConfig ( const uint8_t * data,
size_t len )
inlinevirtualinherited

Some decoders need e.g. a magic cookie to provide the relevant info for decoding.

Reimplemented in DecoderALAC, and MultiDecoder.

◆ setDecoder()

void setDecoder ( AudioDecoder * decoder)
inlineinherited

◆ setNotifyActive() [1/2]

void setNotifyActive ( bool flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active).

◆ setNotifyActive() [2/2]

void setNotifyActive ( bool flag)
inlineinherited

Deactivate/Reactivate automatic AudioInfo updates: (default is active).

◆ setOutput() [1/3]

virtual void setOutput ( AudioOutput & out_stream)
inlinevirtualinherited

Defines where the decoded result is written to.

◆ setOutput() [2/3]

virtual void setOutput ( AudioStream & out_stream)
inlinevirtualinherited

Defines where the decoded result is written to.

◆ setOutput() [3/3]

void setOutput ( Print & print)
inlineoverridevirtualinherited

Defines the output Stream.

Reimplemented from AudioDecoder.

◆ write()

virtual size_t write ( const uint8_t * data,
size_t len )
inlineoverridevirtualinherited

Implements AudioWriter.

◆ writeBlocking() [1/2]

void writeBlocking ( Print * out,
uint8_t * data,
size_t len )
inlineprotectedinherited

◆ writeBlocking() [2/2]

void writeBlocking ( Print * out,
uint8_t * data,
size_t len )
inlineprotectedinherited

Member Data Documentation

◆ buffer

RingBuffer<uint8_t> buffer { ( (1024) )}
protectedinherited

◆ dec_copy

CopyDecoder dec_copy
protectedinherited

◆ id

int id
inherited

custom id to be used by application

◆ info

AudioInfo info
protectedinherited

◆ is_notify_active

bool is_notify_active = true
protectedinherited

◆ is_open

bool is_open = false
protectedinherited

◆ notify_vector

Vector< AudioInfoSupport * > notify_vector
protectedinherited

◆ out

EncodedAudioOutput out
protectedinherited

◆ p_codec

AudioDecoder* p_codec = nullptr
protectedinherited

◆ p_oggz

OGGZ* p_oggz = nullptr
protectedinherited

◆ p_print

Print * p_print = nullptr
protectedinherited

◆ pos

long pos = 0
protectedinherited

◆ vorbis

VorbisDecoder vorbis
protected

Underlying Vorbis decoder.


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