Decoder for FLAC. Depends on https://github.com/pschatzmann/arduino-libflac. We support an efficient streaming API and an very memory intensitiv standard interface. So you should prefer the streaming interface where you call setOutput() before the begin and copy() in the loop. Validated with http://www.2l.no/hires/.
More...
#include <CodecFLAC.h>
Decoder for FLAC. Depends on https://github.com/pschatzmann/arduino-libflac. We support an efficient streaming API and an very memory intensitiv standard interface. So you should prefer the streaming interface where you call setOutput() before the begin and copy() in the loop. Validated with http://www.2l.no/hires/.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
◆ FLACDecoder()
◆ ~FLACDecoder()
Destructor - calls end();.
◆ addNotifyAudioChange()
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.
◆ audioInfo()
Provides the audio information for the current stream.
Returns audio format information such as sample rate, channels, and bits per sample that was determined from the decoded audio stream.
- Returns
- AudioInfo structure containing format information
Implements StreamingDecoder.
◆ 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()
Starts the processing.
Initializes the decoder and prepares it for processing audio data. Must be called before any copy() operations.
- Returns
- true if initialization was successful, false otherwise
Implements StreamingDecoder.
◆ clearNotifyAudioChange()
◆ copy()
Stream Interface: Process a single frame - only relevant when input stream has been defined.
Implements StreamingDecoder.
◆ copyAll()
Process all available data.
Convenience method that calls copy() repeatedly until all available data has been processed.
- Returns
- true if any data was processed, false if no data was available
◆ end()
Releases the reserved memory.
Cleans up any resources allocated by the decoder and stops processing.
Implements StreamingDecoder.
◆ error_callback()
◆ flush()
Process all data in the buffer.
◆ isEof()
We return eof when we were subsequently getting 0 bytes for the timeout period.
◆ isInputFromStream()
| bool isInputFromStream |
( |
| ) |
|
|
inlineprotected |
Check if input is directly from stream - instead of writes.
◆ isNotifyActive()
Checks if the automatic AudioInfo update is active.
◆ isOgg()
returns true of the stream is ogg
◆ mime()
◆ notifyAudioChange()
◆ operator bool()
Checks if the class is active.
- Returns
- true if the decoder is ready and active, false otherwise
Implements StreamingDecoder.
◆ read_callback()
Callback which reads from stream.
◆ readBytes()
|
|
inlineoverrideprotectedvirtual |
Reads bytes from the input stream.
Derived classes must implement this to read data from their input source.
- Parameters
-
| data | Buffer to store the read data |
| len | Maximum number of bytes to read |
- Returns
- Number of bytes actually read
Implements StreamingDecoder.
◆ removeNotifyAudioChange()
◆ setAudioInfo()
|
|
inlineoverrideprotectedvirtualinherited |
◆ setInput()
Stream Interface: Decode directly by taking data from the stream.
This is more efficient than feeding the decoder with write: just call copy() in the loop to process data from the input stream.
- Parameters
-
| inStream | The input stream containing encoded audio data |
◆ setMD5()
Activate/deactivate md5 checking: call this before calling begin()
◆ setNotifyActive()
Deactivate/Reactivate automatic AudioInfo updates: (default is active)
◆ setOgg()
◆ setOutput() [1/3]
Defines the output streams and register to be notified.
Sets the output stream and registers for audio info change notifications.
- Parameters
-
| out_stream | The AudioOutput to write decoded audio data to |
Reimplemented in MultiStreamingDecoder.
◆ setOutput() [2/3]
Defines the output streams and register to be notified.
Sets the output stream and registers for audio info change notifications.
- Parameters
-
| out_stream | The AudioStream to write decoded audio data to |
Reimplemented in MultiStreamingDecoder.
◆ setOutput() [3/3]
◆ setTimeout()
◆ write_callback()
Output decoded result to final output stream.
◆ decoder
◆ info
◆ init_status
◆ is_active
◆ is_md5_checing
◆ is_notify_active
◆ is_ogg
◆ notify_vector
◆ p_input
Input stream for encoded audio data.
◆ p_print
Output stream for decoded PCM data.
◆ read_timeout_ms
◆ time_last_read
The documentation for this class was generated from the following file: