arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpusAudioEncoder Class Reference

OpusAudioEncoder: Dependens on https://github.com/pschatzmann/arduino-libopus.git. More...

#include <CodecOpus.h>

Inheritance diagram for OpusAudioEncoder:
AudioEncoder AudioWriter AudioInfoSupport

Public Member Functions

 OpusAudioEncoder (Print &out)
 
AudioInfo audioInfo ()
 provides the actual input AudioInfo
 
virtual AudioInfo audioInfoOut ()
 provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
 
bool begin () override
 starts the processing using the actual OpusAudioInfo
 
virtual bool begin (AudioInfo info)
 
bool begin (OpusEncoderSettings settings)
 
OpusEncoderSettingsconfig ()
 Provides access to the configuration.
 
OpusEncoderSettingsdefaultConfig ()
 
void end () override
 stops the processing
 
bool isOpen ()
 
const char * mime () override
 Provides "audio/pcm".
 
 operator bool () override
 
void setAudioInfo (AudioInfo from) override
 We actually do nothing with this.
 
void setOutput (Print &out_stream) override
 Defines the output Stream.
 
size_t write (const uint8_t *data, size_t len) override
 Writes PCM data to be encoded as Opus.
 

Protected Member Functions

void encodeByte (uint8_t data)
 
void encodeFrame ()
 
int getFrameSizeSamples (int sampling_rate)
 Returns the frame size in samples.
 
bool settings ()
 
void writeBlocking (Print *out, uint8_t *data, size_t len)
 

Protected Attributes

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

Detailed Description

OpusAudioEncoder: Dependens on https://github.com/pschatzmann/arduino-libopus.git.

Author
Phil Schatzmann

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