arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
audio_tools::OggContainerEncoder Class Reference

OggContainerEncoder - Ogg Container. Encodes a packet for an Ogg container. The Ogg begin segment contains the AudioBaseInfo structure. You can subclass ond overwrite the writeHeader() method to implement your own header logic. More...

#include <ContainerOgg.h>

Inheritance diagram for audio_tools::OggContainerEncoder:
audio_tools::AudioEncoder audio_tools::AudioWriter audio_tools::OpusOggEncoder

Public Member Functions

 OggContainerEncoder (AudioEncoder &encoder)
 
 OggContainerEncoder (AudioEncoder *encoder)
 
virtual void begin () override
 starts the processing using the actual AudioInfo More...
 
virtual void begin (AudioBaseInfo from)
 
void begin (Print &out)
 starts the processing
 
void end () override
 stops the processing More...
 
bool isOpen ()
 
const char * mime () override
 Provides "audio/pcm". More...
 
 operator bool () override
 
virtual void setAudioInfo (AudioBaseInfo from) override
 We actually do nothing with this. More...
 
void setOutputStream (Print &out_stream) override
 Defines the output Stream. More...
 
virtual size_t write (const void *in_ptr, size_t in_size) override
 Writes raw data to be encoded and packaged. More...
 
- Public Member Functions inherited from audio_tools::AudioEncoder
 AudioEncoder (AudioEncoder const &)=delete
 
virtual const char * mime ()=0
 
AudioEncoderoperator= (AudioEncoder const &)=delete
 
virtual void begin ()=0
 
virtual void end ()=0
 
virtual operator bool ()=0
 
virtual void setAudioInfo (AudioBaseInfo from)=0
 
virtual void setOutputStream (Print &out_stream)=0
 
virtual size_t write (const void *in_ptr, size_t in_size)=0
 

Protected Member Functions

virtual bool writeFooter ()
 
virtual bool writeHeader ()
 
virtual bool writePacket (ogg_packet &op, int flag=0)
 

Static Protected Member Functions

static size_t ogg_io_write (void *user_handle, void *buf, size_t n)
 

Protected Attributes

SingleBuffer< uint8_t > buffer {1024}
 
AudioBaseInfo cfg
 
CallbackBufferedStream< uint8_t > codec_buffer {buffer}
 
size_t granulepos = 0
 
bool is_audio = false
 
volatile bool is_open
 
ogg_packet oh
 
ogg_packet op
 
AudioEncoderp_codec = nullptr
 
Printp_encoded_audio_stream = nullptr
 
OGGZ * p_oggz = nullptr
 
Printp_print = nullptr
 
size_t packetno = 0
 
long serialno = -1
 

Detailed Description

OggContainerEncoder - Ogg Container. Encodes a packet for an Ogg container. The Ogg begin segment contains the AudioBaseInfo structure. You can subclass ond overwrite the writeHeader() method to implement your own header logic.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

virtual void audio_tools::OggContainerEncoder::begin ( )
inlineoverridevirtual

starts the processing using the actual AudioInfo

Implements audio_tools::AudioWriter.

Reimplemented in audio_tools::OpusOggEncoder.

◆ end()

void audio_tools::OggContainerEncoder::end ( )
inlineoverridevirtual

stops the processing

Implements audio_tools::AudioWriter.

◆ mime()

const char * audio_tools::OggContainerEncoder::mime ( )
inlineoverridevirtual

Provides "audio/pcm".

Implements audio_tools::AudioEncoder.

◆ operator bool()

audio_tools::OggContainerEncoder::operator bool ( )
inlineoverridevirtual

◆ setAudioInfo()

virtual void audio_tools::OggContainerEncoder::setAudioInfo ( AudioBaseInfo  from)
inlineoverridevirtual

We actually do nothing with this.

Implements audio_tools::AudioWriter.

◆ setOutputStream()

void audio_tools::OggContainerEncoder::setOutputStream ( Print out_stream)
inlineoverridevirtual

Defines the output Stream.

Implements audio_tools::AudioWriter.

◆ write()

virtual size_t audio_tools::OggContainerEncoder::write ( const void *  in_ptr,
size_t  in_size 
)
inlineoverridevirtual

Writes raw data to be encoded and packaged.

Implements audio_tools::AudioWriter.


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