|
arduino-audio-tools
|
Decodes ATRAC3 and ATRAC3+ audio in a Sony OpenMG audio container (.oma, .aa3, .at3): the file starts with an ID3v2 like tag ('ea3' or 'ID3') which is followed by a 96 byte 'EA3' header with the codec parameters. Encrypted files are not supported. More...
#include <ContainerATRAC.h>


Public Member Functions | |
| virtual void | addNotifyAudioChange (AudioInfoSupport &bi) |
| Adds target to be notified about audio changes. | |
| AudioInfo | audioInfo () override |
| provides the actual input AudioInfo | |
| virtual AudioInfo | audioInfoOut () |
| bool | begin () override |
| Prepares the decoder for a new stream. | |
| virtual bool | begin (AudioInfo info) override |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| DecoderATRAC & | decoder () |
| Provides access to the ATRAC decoder. | |
| void | end () override |
| Print * | getOutput () |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| const char * | mime () override |
| Provides the mime type of the data that is expected by this decoder. | |
| operator bool () override | |
| virtual bool | removeNotifyAudioChange (AudioInfoSupport &bi) |
| Removes a target in order not to be notified about audio changes. | |
| void | setAudioInfo (AudioInfo from) override |
| for most decoders this is not needed | |
| virtual bool | setCodecConfig (const uint8_t *data, size_t len) |
| Some decoders need e.g. a magic cookie to provide the relevant info for decoding. | |
| void | setNotifyActive (bool flag) |
| Deactivate/Reactivate automatic AudioInfo updates: (default is active) | |
| virtual void | setOutput (AudioOutput &out_stream) |
| Defines where the decoded result is written to. | |
| virtual void | setOutput (AudioStream &out_stream) |
| Defines where the decoded result is written to. | |
| virtual void | setOutput (Print &out_stream) override |
| Defines where the decoded result is written to. | |
| void | setOutput (Print &out_stream) override |
| Defines where the decoded PCM data is written to. | |
| size_t | write (const uint8_t *data, size_t len) override |
| Processes the container data: returns 0 if the stream is not supported. | |
Public Attributes | |
| int | id |
| custom id to be used by application | |
Protected Types | |
| enum | CodecId { CodecATRAC3 = 0 , CodecATRAC3Plus = 1 } |
| enum | State { Start = 0 , Ea3 } |
Protected Member Functions | |
| bool | collect (const uint8_t *&p, size_t &n, size_t need) |
| Copies the data into hdr until it contains need bytes. | |
| void | fail (const char *msg) |
| void | notifyAudioChange (AudioInfo info) |
| void | parse (const uint8_t *&p, size_t &n) override |
| Processes the header data: must consume data, change the state or fail. | |
| void | parseEa3 () |
| bool | startDecoder (ATRACType type, int sample_rate, int channels, int block_align, const uint8_t *extra=nullptr, size_t extra_size=0, bool known=false, uint32_t length=0) |
| Configures the decoder: the audio data starts after the header. | |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
| void | writePayload (const uint8_t *&p, size_t &n) |
Static Protected Member Functions | |
| static uint16_t | be16 (const uint8_t *p) |
| static uint32_t | be24 (const uint8_t *p) |
| static size_t | syncSafe (const uint8_t *p) |
Protected Attributes | |
| DecoderATRAC | dec |
| Vector< uint8_t > | hdr |
| AudioInfo | info |
| bool | is_active = false |
| bool | is_done = false |
| bool | is_failed = false |
| bool | is_notify_active = true |
| bool | is_streaming = false |
| Vector< AudioInfoSupport * > | notify_vector |
| Print * | p_print = nullptr |
| bool | payload_known = false |
| uint32_t | payload_left = 0 |
| remaining audio bytes (only relevant if payload_known) | |
| size_t | skip_count = 0 |
| int | state = 0 |
Static Protected Attributes | |
| static const size_t | EA3_HEADER_SIZE = 96 |
| static const size_t | ID3_HEADER_SIZE = 10 |
Decodes ATRAC3 and ATRAC3+ audio in a Sony OpenMG audio container (.oma, .aa3, .at3): the file starts with an ID3v2 like tag ('ea3' or 'ID3') which is followed by a 96 byte 'EA3' header with the codec parameters. Encrypted files are not supported.
|
protected |
|
protected |
|
inlinevirtualinherited |
Adds target to be notified about audio changes.
Reimplemented in CodecNOP, EncodedAudioOutput, EncodedAudioStream, AACDecoderFDK, DecoderBasic, CodecChain, MP3DecoderHelix, MP3DecoderMAD, OggContainerDecoder, RTSPClient< TcpClient, UdpSocket >, Pipeline, and Pipeline::ModifyingStreamAdapter.
|
inlineoverridevirtualinherited |
provides the actual input AudioInfo
Implements AudioInfoSupport.
Reimplemented in CodecNOP, DecoderBasic, DSFDecoder, MP3DecoderHelix, MP3DecoderMAD, OpusAudioDecoder, OpusMultiStreamAudioDecoder, VorbisDecoder, WAVDecoder, WavIMADecoder, OggContainerDecoder, and VorbisDecoder.
|
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.
|
inlinestaticprotectedinherited |
|
inlineoverridevirtualinherited |
Prepares the decoder for a new stream.
Reimplemented from AudioDecoder.
Reimplemented from AudioWriter.
Reimplemented in DecoderBasic, and OggContainerDecoder.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
Copies the data into hdr until it contains need bytes.
|
inlineinherited |
Provides access to the ATRAC decoder.
|
inlineoverridevirtualinherited |
Reimplemented from AudioDecoder.
|
inlineprotectedinherited |
|
inlineinherited |
|
inlineoverridevirtual |
Provides the mime type of the data that is expected by this decoder.
Implements AudioDecoder.
|
inlineprotectedinherited |
|
inlineoverridevirtualinherited |
Implements AudioWriter.
Processes the header data: must consume data, change the state or fail.
Implements ContainerATRAC.
|
inlineprotected |
|
inlinevirtualinherited |
Removes a target in order not to be notified about audio changes.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlineoverridevirtualinherited |
for most decoders this is not needed
Implements AudioWriter.
Reimplemented in DecoderALAC, CodecChain, DSFDecoder, DecoderL8, OpusAudioDecoder, OpusMultiStreamAudioDecoder, CodecNOP, G729Decoder, and G7xxDecoder.
Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
Reimplemented in DecoderALAC, DecoderATRAC, and MultiDecoder.
|
inlineinherited |
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
|
inlinevirtualinherited |
Defines where the decoded result is written to.
Reimplemented from AudioDecoder.
|
inlinevirtualinherited |
Defines where the decoded result is written to.
Reimplemented from AudioDecoder.
|
inlineoverridevirtualinherited |
Defines where the decoded result is written to.
Reimplemented from AudioDecoder.
|
inlineoverridevirtualinherited |
Defines where the decoded PCM data is written to.
Reimplemented from AudioDecoder.
|
inlineprotectedinherited |
Configures the decoder: the audio data starts after the header.
Processes the container data: returns 0 if the stream is not supported.
Implements AudioWriter.
|
protectedinherited |
|
staticprotected |
|
inherited |
custom id to be used by application
|
staticprotected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
remaining audio bytes (only relevant if payload_known)
|
protectedinherited |
|
protectedinherited |