Encoder for SBC - Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcenc.c.
More...
#include <CodecSBC.h>
|
|
| SBCEncoder (int subbands=8, int blocks=16, int bitpool=32, int allocation_method=SBC_AM_LOUDNESS) |
| |
| AudioInfo | audioInfo () override |
| | provides the actual input AudioInfo
|
| |
| virtual AudioInfo | audioInfoOut () |
| |
| bool | begin () |
| | Restarts the processing.
|
| |
| virtual bool | begin (AudioInfo info) |
| |
|
int | bytesCompressed () |
| |
|
int | bytesUncompressed () |
| |
| virtual void | end () |
| | Ends the processing.
|
| |
| virtual uint32_t | frameDurationUs () |
| | Optional rtsp function: provide the frame duration in microseconds.
|
| |
| virtual const char * | mime () |
| | Provides the mime type of the encoded result.
|
| |
| | operator bool () |
| |
| virtual uint16_t | samplesPerFrame () |
| | Optional rtsp function: provide samples per the frame.
|
| |
|
void | setAllocationMethod (int allocation_method) |
| | Defines the allocation method: Use SBC_AM_LOUDNESS, SBC_AM_SNR.
|
| |
| void | setAudioInfo (AudioInfo from) override |
| | Defines the sample rate, number of channels and bits per sample.
|
| |
|
void | setBitpool (int bitpool) |
| | Defines the bitpool (2-86?)
|
| |
|
void | setBlocks (int blocks) |
| | Defines the number of blocks: valid values (4,8,12,16)
|
| |
| virtual void | setOutput (Print &out_stream) |
| | Default output assignment (encoders may override to store Print reference)
|
| |
|
void | setSubbands (int subbands) |
| | Defines the subbands: Use 4 or 8.
|
| |
| virtual size_t | write (const uint8_t *data, size_t len) |
| |
|
|
int | codeSize () |
| | Provides the uncompressed length (of the PCM data) in bytes.
|
| |
|
int | frameLength () |
| | Provides the compressed length in bytes (after encoding)
|
| |
|
void | processByte (uint8_t byte) |
| |
|
bool | setup () |
| | Determines audio information and calls sbc_init;.
|
| |
|
void | writeBlocking (Print *out, uint8_t *data, size_t len) |
| |
|
|
int | allocation_method |
| |
|
int | bitpool = 32 |
| |
|
int | blocks = 4 |
| |
|
Vector< uint8_t > | buffer {0} |
| |
|
int | buffer_pos = 0 |
| |
|
int | current_codesize = 0 |
| |
|
AudioInfo | info |
| |
|
bool | is_active = false |
| |
|
bool | is_first = true |
| |
|
Print * | p_print = nullptr |
| |
|
Vector< uint8_t > | result_buffer {0} |
| |
|
sbc_t | sbc |
| |
|
int | subbands = 4 |
| |
Encoder for SBC - Depends on https://github.com/pschatzmann/arduino-libsbc. Inspired by sbcenc.c.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ audioInfo()
|
|
inlineoverridevirtualinherited |
◆ audioInfoOut()
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
◆ begin() [1/2]
◆ begin() [2/2]
◆ end()
◆ frameDurationUs()
| virtual uint32_t frameDurationUs |
( |
| ) |
|
|
inlinevirtualinherited |
◆ mime()
| virtual const char * mime |
( |
| ) |
|
|
inlinevirtual |
Provides the mime type of the encoded result.
Implements AudioEncoder.
◆ operator bool()
◆ samplesPerFrame()
| virtual uint16_t samplesPerFrame |
( |
| ) |
|
|
inlinevirtualinherited |
◆ setAudioInfo()
|
|
inlineoverridevirtualinherited |
Defines the sample rate, number of channels and bits per sample.
Implements AudioWriter.
Reimplemented in MP3EncoderLAME, EncoderBasic, CodecChain, FLACEncoder, OpusAudioEncoder, WAVEncoder, CodecNOP, G7xxEncoder, BinaryContainerEncoder, OggContainerEncoder, OSCContainerEncoder, and MetaDataFilterEncoder.
◆ setOutput()
| virtual void setOutput |
( |
Print & |
out_stream | ) |
|
|
inlinevirtual |
Default output assignment (encoders may override to store Print reference)
Reimplemented from AudioEncoder.
◆ write()
| virtual size_t write |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtual |
The documentation for this class was generated from the following file: