arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::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 audio_tools::VS1053Stream:
audio_tools::AudioStreamX audio_tools::AudioStream audio_tools::Stream audio_tools::AudioBaseInfoDependent audio_tools::AudioBaseInfoSource audio_tools::Print

Public Member Functions

int available () override
 
float balance ()
 Get the currenet balance setting (-1.0..1.0)
 
float bass ()
 Provides the Bass amplitude value.
 
bool begin ()
 Starts with the default config or restarts. More...
 
bool begin (VS1053Config cfg)
 Starts with the indicated configuration.
 
VS1053Config defaultConfig (RxTxMode mode=TX_MODE)
 
void end ()
 Stops the processing and releases the memory. More...
 
VS1053 & getVS1053 ()
 returns the VS1053 object
 
size_t readBytes (uint8_t *data, size_t len) override
 
void sendMidiMessage (uint8_t cmd, uint8_t data1, uint8_t data2)
 Sends a midi message to the VS1053.
 
void setAudioInfo (AudioBaseInfo 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.
 
void setBass (float val)
 Sets the bass amplitude value (range 0 to 1.0)
 
void setBassFrequencyLimit (uint16_t value)
 Sets the bass frequency limit in hz (range 0 to 15000)
 
bool setEncoder (AudioEncoder *enc)
 Defines an alternative encoder that will be used (e.g. MP3Encoder). It must be allocated on the heap!
 
void setTreble (float val)
 Sets the treble amplitude value (range 0 to 1.0)
 
void setTrebleFrequencyLimit (uint16_t value)
 Sets the treble frequency limit in hz (range 0 to 15000)
 
void setVolume (float vol)
 value from 0 to 1.0
 
float treble ()
 Provides the treble amplitude value.
 
float volume ()
 provides the volume
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 Write audio data. More...
 
- Public Member Functions inherited from audio_tools::AudioStreamX
 AudioStreamX (AudioStreamX const &)=delete
 
virtual int available () override
 
AudioStreamXoperator= (AudioStreamX const &)=delete
 
virtual int peek () override
 
virtual int read () override
 
virtual size_t readBytes (uint8_t *buffer, size_t length) override
 
virtual size_t write (const uint8_t *buffer, size_t size) override
 
virtual size_t write (uint8_t) override
 
- 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

bool beginMidi ()
 
bool beginRx ()
 
bool beginTx ()
 
void logError (const char *str)
 
- Protected Member Functions inherited from audio_tools::AudioStream
virtual int not_supported (int out)
 

Protected Attributes

VS1053Config cfg
 
CopyEncoder copy
 
AudioEncoderp_encoder = new WAVEncoder()
 
EncodedAudioStreamp_out = nullptr
 
VS1053 * p_vs1053 = nullptr
 
VS1053StreamOut * p_vs1053_out = nullptr
 
- Protected Attributes inherited from audio_tools::AudioStream
AudioBaseInfo info
 
AudioBaseInfoDependentp_notify =nullptr
 

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

Member Function Documentation

◆ available()

int audio_tools::VS1053Stream::available ( )
inlineoverridevirtual

Reimplemented from audio_tools::AudioStreamX.

◆ begin()

bool audio_tools::VS1053Stream::begin ( )
inlinevirtual

Starts with the default config or restarts.

Reimplemented from audio_tools::AudioStream.

◆ end()

void audio_tools::VS1053Stream::end ( )
inlinevirtual

Stops the processing and releases the memory.

Reimplemented from audio_tools::AudioStream.

◆ readBytes()

size_t audio_tools::VS1053Stream::readBytes ( uint8_t *  data,
size_t  len 
)
inlineoverridevirtual

Reimplemented from audio_tools::AudioStreamX.

◆ setAudioInfo()

void audio_tools::VS1053Stream::setAudioInfo ( AudioBaseInfo  c)
inlinevirtual

Reimplemented from audio_tools::AudioStream.

◆ write()

virtual size_t audio_tools::VS1053Stream::write ( const uint8_t *  buffer,
size_t  size 
)
inlineoverridevirtual

Write audio data.

Reimplemented from audio_tools::AudioStreamX.


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