ESPHome  2024.10.2
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 void finish ()
 
virtual bool has_buffered_data () const =0
 
bool is_running () const
 
bool is_stopped () const
 

Protected Attributes

State state_ {STATE_STOPPED}
 

Detailed Description

Definition at line 17 of file speaker.h.

Member Function Documentation

◆ finish()

virtual void esphome::speaker::Speaker::finish ( )
inlinevirtual

Reimplemented in esphome::i2s_audio::I2SAudioSpeaker.

Definition at line 27 of file speaker.h.

◆ 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 31 of file speaker.h.

◆ is_stopped()

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

Definition at line 32 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 20 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 35 of file speaker.h.


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