ESPHome  2024.7.0
Public Member Functions | Protected Attributes
esphome::speaker::Speaker Class Referenceabstract

#include <speaker.h>

Inheritance diagram for esphome::speaker::Speaker:
esphome::i2s_audio::I2SAudioSpeaker

Public Member Functions

virtual size_t play (const uint8_t *data, size_t length)=0
 
size_t play (const std::vector< uint8_t > &data)
 
virtual void start ()=0
 
virtual void stop ()=0
 
virtual bool has_buffered_data () const =0
 
bool is_running () const
 

Protected Attributes

State state_ {STATE_STOPPED}
 

Detailed Description

Definition at line 13 of file speaker.h.

Member Function Documentation

◆ has_buffered_data()

virtual bool esphome::speaker::Speaker::has_buffered_data ( ) const
pure virtual

◆ is_running()

bool esphome::speaker::Speaker::is_running ( ) const
inline

Definition at line 23 of file speaker.h.

◆ play() [1/2]

virtual size_t esphome::speaker::Speaker::play ( const uint8_t *  data,
size_t  length 
)
pure virtual

◆ play() [2/2]

size_t esphome::speaker::Speaker::play ( const std::vector< uint8_t > &  data)
inline

Definition at line 16 of file speaker.h.

◆ start()

virtual void esphome::speaker::Speaker::start ( )
pure virtual

◆ stop()

virtual void esphome::speaker::Speaker::stop ( )
pure virtual

Field Documentation

◆ state_

State esphome::speaker::Speaker::state_ {STATE_STOPPED}
protected

Definition at line 26 of file speaker.h.


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