|
arduino-audio-tools
|
M4A Demuxer that extracts audio from M4A/MP4 containers. The audio is decoded into pcm with the help of the provided decoder. format. More...
#include <ContainerM4A.h>
Public Member Functions | |
| ContainerM4A () | |
| Default constructor: If no decoder is provided, the raw audio data is provided to the defined output. | |
| ContainerM4A (MultiDecoder &decoder) | |
| Constructor with decoder. Sets up the demuxer and decoder notification. | |
| 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 |
| Initialize the demuxer and decoder. | |
| virtual bool | begin (AudioInfo info) override |
| virtual void | clearNotifyAudioChange () |
| Deletes all change notify subscriptions. | |
| void | end () override |
| End the demuxer and decoder, releasing resources. | |
| M4AAudioDemuxer & | getDemuxer () |
| Print * | getOutput () |
| bool | isNotifyActive () |
| Checks if the automatic AudioInfo update is active. | |
| bool | isResultPCM () override |
| Returns true if the result is PCM (decoder is present). | |
| operator bool () override | |
| Returns true if the demuxer is active. | |
| 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 void | setChunkOffsetsBuffer (BaseBuffer< uint32_t > &buffer) |
| Sets the buffer to use for sample sizes. This is currently not used! | |
| 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. | |
| bool | setDecoder (MultiDecoder &decoder) |
| Sets the decoder to use for audio frames. | |
| 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. | |
| void | setOutput (Print &out_stream) override |
| Set the output stream for decoded or raw audio. | |
| virtual void | setSampleSizesBuffer (BaseBuffer< stsz_sample_size_t > &buffer) |
| Sets the buffer to use for sample sizes. You can use this to provide a custom buffer that does not rely on RAM (e.g a file based buffer or one using Redis) | |
| size_t | write (const uint8_t *data, size_t len) override |
| Feed data to the demuxer for parsing. | |
Public Attributes | |
| int | id |
| custom id to be used by application | |
Protected Member Functions | |
| void | notifyAudioChange (AudioInfo info) |
| void | writeBlocking (Print *out, uint8_t *data, size_t len) |
Static Protected Member Functions | |
| static void | decodeAudio (const M4AAudioDemuxer::Frame &frame, void *ref) |
| Static callback for demuxed audio frames. Handles decoder selection and magic cookie for ALAC. | |
Protected Attributes | |
| M4AAudioDemuxer | demux |
| Internal demuxer instance. | |
| AudioInfo | info |
| bool | is_active = false |
| True if demuxer is active. | |
| bool | is_magic_cookie_processed |
| True if ALAC magic cookie has been processed. | |
| bool | is_notify_active = true |
| Vector< AudioInfoSupport * > | notify_vector |
| MultiDecoder * | p_decoder = nullptr |
| Pointer to the MultiDecoder. | |
| Print * | p_print = nullptr |
M4A Demuxer that extracts audio from M4A/MP4 containers. The audio is decoded into pcm with the help of the provided decoder. format.
|
inline |
Constructor with decoder. Sets up the demuxer and decoder notification.
| decoder | Reference to a MultiDecoder for PCM output. |
|
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, 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 PureDataStream, PWMAudioOutput, ChannelFormatConverterStreamT< T >, ChannelFormatConverterStream, NumberFormatConverterStreamT< TFrom, TTo >, NumberFormatConverterStream, FormatConverterStream, Pipeline, ResampleStream, and ResampleStreamT< TInterpolator >.
|
inlineoverridevirtual |
|
inlineoverridevirtualinherited |
Reimplemented from AudioWriter.
|
inlinevirtualinherited |
Deletes all change notify subscriptions.
Reimplemented in RTSPClient< TcpClient, UdpSocket >.
|
inlinestaticprotected |
Static callback for demuxed audio frames. Handles decoder selection and magic cookie for ALAC.
| frame | The demuxed audio frame. |
| ref | Reference to the ContainerM4A instance. |
|
inlineoverridevirtual |
End the demuxer and decoder, releasing resources.
Reimplemented from AudioDecoder.
|
inlineoverridevirtual |
Returns true if the result is PCM (decoder is present).
Reimplemented from ContainerDecoder.
|
inlineoverridevirtual |
Returns true if the demuxer is active.
Implements AudioWriter.
|
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, CodecNOP, and G7xxDecoder.
|
inlinevirtual |
Sets the buffer to use for sample sizes. This is currently not used!
| buffer | Reference to the buffer to use. |
|
inlinevirtualinherited |
Some decoders need e.g. a magic cookie to provide the relevant info for decoding.
Reimplemented in DecoderALAC, and MultiDecoder.
|
inline |
Sets the decoder to use for audio frames.
| decoder | Reference to a MultiDecoder for PCM output. |
|
inlinevirtualinherited |
Defines where the decoded result is written to.
Reimplemented in ADTSDecoder, CodecChain, MTSDecoder, MTSDecoderTSDemux, and MetaDataFilterDecoder.
|
inlinevirtualinherited |
Defines where the decoded result is written to.
Reimplemented in ADTSDecoder, CodecChain, MTSDecoder, MTSDecoderTSDemux, and MetaDataFilterDecoder.
|
inlineoverridevirtual |
Set the output stream for decoded or raw audio.
| out_stream | Output AudioStream. |
Reimplemented from AudioDecoder.
|
inlinevirtual |
Sets the buffer to use for sample sizes. You can use this to provide a custom buffer that does not rely on RAM (e.g a file based buffer or one using Redis)
| buffer | Reference to the buffer to use. |
|
inlineoverridevirtual |
Feed data to the demuxer for parsing.
| data | Pointer to input data. |
| len | Length of input data. |
Implements AudioWriter.
|
protected |
True if ALAC magic cookie has been processed.