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

OpusDecoder - Actually this class does no encoding or decoding at all. It just passes on the data. Dependent on https://github.com/pschatzmann/arduino-libopus.git. More...

#include <CodecOpus.h>

Inheritance diagram for audio_tools::OpusAudioEncoder:
audio_tools::AudioEncoder audio_tools::AudioWriter

Public Member Functions

 OpusAudioEncoder (Print &out)
 
void begin () override
 starts the processing using the actual OpusAudioInfo More...
 
void begin (OpusEncoderSettings settings)
 
OpusEncoderSettingsconfig ()
 Provides access to the configuration.
 
OpusEncoderSettingsdefaultConfig ()
 
void end () override
 stops the processing More...
 
bool isOpen ()
 
const char * mime () override
 Provides "audio/pcm". More...
 
 operator bool () override
 
void setAudioInfo (AudioBaseInfo from) override
 We actually do nothing with this. More...
 
void setOutputStream (Print &out_stream) override
 Defines the output Stream. More...
 
size_t write (const void *in_ptr, size_t in_size)
 Writes PCM data to be encoded as Opus. 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

void encodeByte (uint8_t data)
 
void encodeFrame ()
 
int getFrameSizeSamples (int sampling_rate)
 Returns the frame size in samples.
 
bool settings ()
 

Protected Attributes

OpusEncoderSettings cfg
 
OpusEncoder * enc = nullptr
 
Vector< uint8_t > frame {0}
 
int frame_pos = 0
 
bool is_open = false
 
Printp_print = nullptr
 

Detailed Description

OpusDecoder - Actually this class does no encoding or decoding at all. It just passes on the data. Dependent on https://github.com/pschatzmann/arduino-libopus.git.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

void audio_tools::OpusAudioEncoder::begin ( )
inlineoverridevirtual

starts the processing using the actual OpusAudioInfo

Implements audio_tools::AudioWriter.

◆ end()

void audio_tools::OpusAudioEncoder::end ( )
inlineoverridevirtual

stops the processing

Implements audio_tools::AudioWriter.

◆ mime()

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

Provides "audio/pcm".

Implements audio_tools::AudioEncoder.

◆ operator bool()

audio_tools::OpusAudioEncoder::operator bool ( )
inlineoverridevirtual

◆ setAudioInfo()

void audio_tools::OpusAudioEncoder::setAudioInfo ( AudioBaseInfo  from)
inlineoverridevirtual

We actually do nothing with this.

Implements audio_tools::AudioWriter.

◆ setOutputStream()

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

Defines the output Stream.

Implements audio_tools::AudioWriter.

◆ write()

size_t audio_tools::OpusAudioEncoder::write ( const void *  in_ptr,
size_t  in_size 
)
inlinevirtual

Writes PCM data to be encoded as Opus.

Implements audio_tools::AudioWriter.


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