arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::AudioOutputWithCallback Class Reference

ESP8266Audio AudioOutput class which stores the data in a temporary buffer. The buffer can be consumed e.g. by a callback function by calling read();. More...

#include <AudioESP8266.h>

Inheritance diagram for audio_tools::AudioOutputWithCallback:
audio_tools::BufferedStream audio_tools::AudioStream audio_tools::Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource audio_tools::Print

Public Member Functions

 AudioOutputWithCallback (int bufferSize, int bufferCount)
 
virtual bool begin ()
 Activates the output. More...
 
virtual bool ConsumeSample (int16_t sample[2])
 puts the sample into a buffer
 
size_t read (Frame *src, size_t len)
 Provides the data from the internal buffer to the callback.
 
virtual bool stop ()
 stops the processing
 
- Public Member Functions inherited from audio_tools::BufferedStream
 BufferedStream (size_t buffer_size)
 
virtual int available () override
 Returns the available bytes in the buffer: to be avoided. More...
 
void clear ()
 Clears all the data in the buffer.
 
virtual void flush () override
 empties the buffer More...
 
virtual int peek () override
 peeks a byte - to be avoided More...
 
virtual int read () override
 reads a byte - to be avoided More...
 
size_t readBytes (uint8_t *data, size_t length) override
 Use this method !! More...
 
virtual size_t write (const uint8_t *data, size_t len) override
 Use this method: write an array. More...
 
virtual size_t write (uint8_t c) override
 writes a byte to the buffer More...
 
- Public Member Functions inherited from audio_tools::AudioStream
 AudioStream (AudioStream const &)=delete
 
virtual AudioBaseInfo audioInfo () override
 
virtual int availableForWrite () override
 
virtual bool begin ()
 
virtual void end ()
 
virtual void flush () override
 
 operator bool ()
 
AudioStreamoperator= (AudioStream const &)=delete
 
virtual size_t readBytes (char *buffer, size_t length)
 
virtual size_t readBytes (uint8_t *buffer, size_t length) STREAM_WRITE_OVERRIDE=0
 
virtual void setAudioInfo (AudioBaseInfo info) override
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi) override
 
virtual StreamtoStreamPointer ()
 
virtual size_t write (const uint8_t *buffer, size_t size) override=0
 
- Public Member Functions inherited from audio_tools::Stream
virtual int available ()
 
virtual int peek ()
 
virtual int read ()
 
virtual size_t readBytes (uint8_t *buffer, size_t len)
 
virtual void setTimeout (size_t t)
 
- Public Member Functions inherited from audio_tools::Print
virtual int availableForWrite ()
 
virtual void flush ()
 
virtual int print (char c, PrintCharFmt spec)
 
virtual int print (const char *msg)
 
virtual int print (int number)
 
virtual int println (const char *msg="")
 
virtual size_t write (const char *buffer, size_t size)
 
virtual size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
virtual size_t write (uint8_t ch)
 
- Public Member Functions inherited from audio_tools::AudioBaseInfoDependent
virtual AudioBaseInfo audioInfo ()=0
 
virtual void setAudioInfo (AudioBaseInfo info)=0
 
virtual bool validate (AudioBaseInfo &info)
 
virtual void setNotifyAudioChange (AudioBaseInfoDependent &bi)=0
 

Protected Member Functions

virtual size_t readExt (uint8_t *data, size_t len)
 
virtual size_t writeExt (const uint8_t *data, size_t len)
 
- Protected Member Functions inherited from audio_tools::BufferedStream
virtual size_t readExt (uint8_t *data, size_t length)=0
 
void refill ()
 
virtual size_t writeExt (const uint8_t *data, size_t len)=0
 
- Protected Member Functions inherited from audio_tools::AudioStream
virtual int not_supported (int out)
 

Protected Attributes

bool active
 
NBuffer< Frame > * callback_buffer_ptr
 
- Protected Attributes inherited from audio_tools::BufferedStream
SingleBuffer< uint8_t > * buffer = nullptr
 
- Protected Attributes inherited from audio_tools::AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 

Detailed Description

ESP8266Audio AudioOutput class which stores the data in a temporary buffer. The buffer can be consumed e.g. by a callback function by calling read();.

Author
Phil Schatzmann

Member Function Documentation

◆ begin()

virtual bool audio_tools::AudioOutputWithCallback::begin ( )
inlinevirtual

Activates the output.

Reimplemented from audio_tools::AudioStream.

◆ readExt()

virtual size_t audio_tools::AudioOutputWithCallback::readExt ( uint8_t *  data,
size_t  len 
)
inlineprotectedvirtual

◆ writeExt()

virtual size_t audio_tools::AudioOutputWithCallback::writeExt ( const uint8_t *  data,
size_t  len 
)
inlineprotectedvirtual

The documentation for this class was generated from the following file: