|
arduino-audio-tools
|
Encodes PCM data to the MP3 format and writes the result to a stream This is basically just a wrapper using https://github.com/pschatzmann/codec-lame. More...
#include <CodecMP3LAME.h>
Classes | |
| class | FrameWriter |
| Receives the output of LAME and passes it on in complete MP3 frames. More... | |
Public Member Functions | |
| MP3EncoderLAME (bool splitFrames=false) | |
| MP3EncoderLAME (Print &out_stream, bool splitFrames=false) | |
| ~MP3EncoderLAME () | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| AudioInfoLAME & | audioInfoExt () |
| virtual AudioInfo | audioInfoOut () |
| bool | begin () |
| virtual bool | begin (AudioInfo info) |
| bool | begin (AudioInfoLAME from) |
| AudioInfoLAME | defaultConfig () |
| liblame::MP3EncoderLAME * | driver () |
| void | end () |
| virtual uint32_t | frameDurationUs () |
| Optional rtsp function: provide the frame duration in microseconds. | |
| virtual int | frameSize () |
| const char * | mime () |
| Provides the mime type of the encoded result. | |
| virtual | operator bool () |
| virtual uint16_t | samplesPerFrame () |
| Optional rtsp function: provide samples per the frame. | |
| void | setAudioInfo (AudioInfo from) |
| Defines the Audio Info. | |
| void | setAudioInfo (AudioInfoLAME from) |
| Defines the Audio Info. | |
| void | setOutput (Print &out_stream) |
| Defines the output stream. | |
| size_t | write (const uint8_t *data, size_t len) |
Protected Member Functions | |
| void | createEnc () |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Protected Attributes | |
| liblame::MP3EncoderLAME * | enc =nullptr |
| FrameWriter | frame_writer {frames} |
| HeaderParserMP3 | frames |
| AudioInfo | info |
| AudioInfoLAME | lame_info |
| Print * | p_print =nullptr |
| bool | split_frames = false |
Static Protected Attributes | |
| static constexpr int | kMaxFrameSize = 2048 |
| Buffer size for the frame splitting: bigger than the largest MP3 frame. | |
Encodes PCM data to the MP3 format and writes the result to a stream This is basically just a wrapper using https://github.com/pschatzmann/codec-lame.
LAME delivers its output in arbitrary chunks (zero, one or several MP3 frames per write()). Pass splitFrames = true to the constructor to get exactly one complete MP3 frame per write() to the output instead - as e.g. the video muxers (MuxerMTS, MuxerAVI, ...) expect it.
|
inline |
| splitFrames | true: write exactly one complete MP3 frame per write() |
|
inline |
| splitFrames | true: write exactly one complete MP3 frame per write() |
|
inline |
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in CodecNOP, MP3EncoderShine, BinaryContainerEncoder, and MP3ParserEncoder.
|
inline |
|
inlinevirtualinherited |
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.
|
inlinevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Reimplemented in OpusOggEncoder, OggContainerEncoder, DecoderBasic, AudioDecoder, AACEncoderFAAC, AACEncoderFDK, AACEncoderVO, OggContainerDecoder, and MetaDataFilterEncoder.
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inlinevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide the frame duration in microseconds.
Reimplemented in ADPCMEncoder, MP3EncoderShine, OpusOggEncoder, MP3ParserEncoder, and MetaDataFilterEncoder.
|
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.
|
inlinevirtual |
Provides the mime type of the encoded result.
Implements AudioEncoder.
|
inlinevirtual |
Implements AudioWriter.
|
inlinevirtualinherited |
Optional rtsp function: provide samples per the frame.
Reimplemented in OpusAudioEncoder, OpusMultiStreamAudioEncoder, MP3EncoderShine, MP3ParserEncoder, and MetaDataFilterEncoder.
|
inlinevirtual |
Defines the Audio Info.
Reimplemented from AudioEncoder.
|
inline |
Defines the Audio Info.
|
inlinevirtual |
Defines the output stream.
Reimplemented from AudioEncoder.
|
inlinevirtual |
Implements AudioWriter.
|
inlineprotectedinherited |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
|
staticconstexprprotected |
Buffer size for the frame splitting: bigger than the largest MP3 frame.
|
protected |
|
protected |
|
protected |