arduino-audio-tools
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VS1053Stream Class Reference

VS1053 Output Interface which processes PCM data by default. If you want to write encoded data set is_encoded_data = true in the configuration;. More...

#include <VS1053Stream.h>

Inheritance diagram for VS1053Stream:
AudioStream Stream AudioInfoSupport AudioInfoSource Print

Public Member Functions

virtual AudioInfo audioInfo () override
 
virtual int available () override
 
virtual int availableForWrite () override
 
float balance ()
 Get the currenet balance setting (-1.0..1.0)
 
bool begin ()
 Starts with the default config or restarts.
 
bool begin (VS1053Config cfg)
 Starts with the indicated configuration.
 
VS1053Config defaultConfig (RxTxMode mode=TX_MODE)
 
void end ()
 Stops the processing and releases the memory.
 
virtual void flush () override
 
VS1053 & getVS1053 ()
 returns the VS1053 object
 
 operator bool ()
 
virtual size_t readBytes (uint8_t *buffer, size_t length)
 
virtual size_t readSilence (uint8_t *buffer, size_t length)
 Source to generate silence: just sets the buffer to 0.
 
void setAudioInfo (AudioInfo c)
 
void setAudioInfo (VS1053Config c)
 defines the default configuration that is used with the next begin()
 
void setBalance (float bal)
 Adjusting the left and right volume balance, higher to enhance the right side, lower to enhance the left side.
 
bool setEncoder (AudioEncoder *enc)
 Defines an alternative encoder that will be used (e.g. MP3Encoder). It must be allocated on the heap!
 
virtual void setNotifyAudioChange (AudioInfoSupport &bi) override
 
void setVolume (float vol)
 value from 0 to 1.0
 
virtual bool validate (AudioInfo &info)
 
float volume ()
 provides the volume
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 Write audio data.
 
virtual size_t write (uint8_t ch) override
 
virtual void writeSilence (size_t len)
 Writes len bytes of silence (=0).
 

Protected Member Functions

bool beginTx ()
 
void logError (const char *str)
 
virtual int not_supported (int out, const char *msg="")
 
void refillReadBuffer ()
 

Protected Attributes

VS1053Config cfg
 
CopyEncoder copy
 
AudioInfo info
 
AudioEncoderp_encoder = new WAVEncoder()
 
AudioInfoSupportp_notify =nullptr
 
EncodedAudioStreamp_out = nullptr
 
VS1053 * p_vs1053 = nullptr
 
VS1053StreamOut * p_vs1053_out = nullptr
 
RingBuffer< uint8_t > tmp_in {0}
 
RingBuffer< uint8_t > tmp_out {0}
 

Detailed Description

VS1053 Output Interface which processes PCM data by default. If you want to write encoded data set is_encoded_data = true in the configuration;.

Author
Phil Schatzmann

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