Encoder for SBC - Depends on https://github.com/pschatzmann/codec-sbc. Inspired by sbcenc.c.
More...
#include <CodecSBC.h>
|
| 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) |
| |
Encoder for SBC - Depends on https://github.com/pschatzmann/codec-sbc. Inspired by sbcenc.c.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ SBCEncoder()
| SBCEncoder |
( |
int |
subbands = 8, |
|
|
int |
blocks = 16, |
|
|
int |
bitpool = 32, |
|
|
int |
allocation_method = SBC_AM_LOUDNESS |
|
) |
| |
|
inline |
◆ audioInfo()
|
|
inlineoverridevirtualinherited |
◆ audioInfoOut()
provides the actual output AudioInfo: this is usually the same as audioInfo() unless we use a transforming stream
Reimplemented in MP3EncoderShine, PureDataStream, PWMAudioOutput< PWMDriverT >, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, ResampleStreamT< TInterpolator >, and SupportedRatesStream.
◆ begin() [1/2]
◆ begin() [2/2]
◆ bytesCompressed()
◆ bytesUncompressed()
| int bytesUncompressed |
( |
| ) |
|
|
inline |
◆ codeSize()
Provides the uncompressed length (of the PCM data) in bytes.
◆ end()
◆ frameDurationUs()
| virtual uint32_t frameDurationUs |
( |
| ) |
|
|
inlinevirtualinherited |
◆ frameLength()
Provides the compressed length in bytes (after encoding)
◆ frameSize()
| virtual int frameSize |
( |
| ) |
|
|
inlinevirtualinherited |
Optional rtsp function: provide the encoded size (in bytes) of one frame, once known (e.g. after the encoder has seen real data). Lets an RTSPFormat size its RTP fragments to match one frame instead of a fixed guess, so throughput actually tracks frameDurationUs() - a fragment size covering several frames' worth of bytes sent at one-frame timing overruns real-time bandwidth and, over UDP (no flow control), causes packet loss. Returns 0 if not yet known/not applicable (fixed-frame-size codecs have no need to override this).
Reimplemented in ADPCMEncoder, EncoderALAC, AMRNBEncoder, AMRWBEncoder, and MP3ParserEncoder.
◆ mime()
| virtual const char * mime |
( |
| ) |
|
|
inlinevirtual |
Provides the mime type of the encoded result.
Implements AudioEncoder.
◆ operator bool()
◆ processByte()
| void processByte |
( |
uint8_t |
byte | ) |
|
|
inlineprotected |
◆ samplesPerFrame()
| virtual uint16_t samplesPerFrame |
( |
| ) |
|
|
inlinevirtualinherited |
◆ setAllocationMethod()
| void setAllocationMethod |
( |
int |
allocation_method | ) |
|
|
inline |
Defines the allocation method: Use SBC_AM_LOUDNESS, SBC_AM_SNR.
◆ setAudioInfo()
|
|
inlineoverridevirtualinherited |
Defines the sample rate, number of channels and bits per sample.
Implements AudioWriter.
Reimplemented in MP3EncoderLAME, EncoderBasic, CodecChain, DSFEncoder, FLACEncoder, MP3EncoderShine, OpusAudioEncoder, OpusMultiStreamAudioEncoder, WAVEncoder, CodecNOP, G7xxEncoder, G729Encoder, BinaryContainerEncoder, OggContainerEncoder, OSCContainerEncoder, H264RtpEncoder, JPEGRtpEncoder, and MetaDataFilterEncoder.
◆ setBitpool()
| void setBitpool |
( |
int |
bitpool | ) |
|
|
inline |
Defines the bitpool (2-86?)
◆ setBlocks()
| void setBlocks |
( |
int |
blocks | ) |
|
|
inline |
Defines the number of blocks: valid values (4,8,12,16)
◆ setOutput()
| virtual void setOutput |
( |
Print & |
out_stream | ) |
|
|
inlinevirtual |
Default output assignment (encoders may override to store Print reference)
Reimplemented from AudioEncoder.
◆ setSubbands()
| void setSubbands |
( |
int |
subbands | ) |
|
|
inline |
Defines the subbands: Use 4 or 8.
◆ setup()
Determines audio information and calls sbc_init;.
◆ write()
| virtual size_t write |
( |
const uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtual |
◆ writeBlocking()
| void writeBlocking |
( |
Print * |
out, |
|
|
uint8_t * |
data, |
|
|
size_t |
len |
|
) |
| |
|
inlineprotectedinherited |
◆ allocation_method
◆ bitpool
◆ blocks
◆ buffer
◆ buffer_pos
◆ current_codesize
◆ info
◆ is_active
◆ is_first
◆ p_print
◆ result_buffer
| Vector<uint8_t> result_buffer {0} |
|
protected |
◆ sbc
◆ subbands
The documentation for this class was generated from the following file: