#include <speaker.h>
Definition at line 28 of file speaker.h.
◆ finish()
virtual void esphome::speaker::Speaker::finish |
( |
| ) |
|
|
inlinevirtual |
◆ get_mute_state()
bool esphome::speaker::Speaker::get_mute_state |
( |
| ) |
|
|
inline |
◆ get_volume()
float esphome::speaker::Speaker::get_volume |
( |
| ) |
|
|
inline |
◆ has_buffered_data()
virtual bool esphome::speaker::Speaker::has_buffered_data |
( |
| ) |
const |
|
pure virtual |
◆ is_running()
bool esphome::speaker::Speaker::is_running |
( |
| ) |
const |
|
inline |
◆ is_stopped()
bool esphome::speaker::Speaker::is_stopped |
( |
| ) |
const |
|
inline |
◆ play() [1/3]
virtual size_t esphome::speaker::Speaker::play |
( |
const uint8_t * |
data, |
|
|
size_t |
length, |
|
|
TickType_t |
ticks_to_wait |
|
) |
| |
|
inlinevirtual |
Plays the provided audio data.
If the speaker component doesn't implement this method, it falls back to the play method without this parameter.
- Parameters
-
data | Audio data in the format specified by set_audio_stream_info method. |
length | The length of the audio data in bytes. |
ticks_to_wait | The FreeRTOS ticks to wait before writing as much data as possible to the ring buffer. |
- Returns
- The number of bytes that were actually written to the speaker's internal buffer.
Reimplemented in esphome::i2s_audio::I2SAudioSpeaker.
Definition at line 37 of file speaker.h.
◆ play() [2/3]
virtual size_t esphome::speaker::Speaker::play |
( |
const uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
|
pure virtual |
Plays the provided audio data.
If the audio stream is not the default defined in "esphome/core/audio.h" and the speaker component implements it, then this should be called after calling set_audio_stream_info
.
- Parameters
-
data | Audio data in the format specified by set_audio_stream_info method. |
length | The length of the audio data in bytes. |
- Returns
- The number of bytes that were actually written to the speaker's internal buffer.
Implemented in esphome::i2s_audio::I2SAudioSpeaker.
◆ play() [3/3]
size_t esphome::speaker::Speaker::play |
( |
const std::vector< uint8_t > & |
data | ) |
|
|
inline |
◆ set_audio_dac()
◆ set_audio_stream_info()
◆ set_mute_state()
virtual void esphome::speaker::Speaker::set_mute_state |
( |
bool |
mute_state | ) |
|
|
inlinevirtual |
◆ set_volume()
virtual void esphome::speaker::Speaker::set_volume |
( |
float |
volume | ) |
|
|
inlinevirtual |
◆ start()
virtual void esphome::speaker::Speaker::start |
( |
| ) |
|
|
pure virtual |
◆ stop()
virtual void esphome::speaker::Speaker::stop |
( |
| ) |
|
|
pure virtual |
◆ audio_dac_
◆ audio_stream_info_
◆ mute_state_
bool esphome::speaker::Speaker::mute_state_ {false} |
|
protected |
◆ state_
◆ volume_
float esphome::speaker::Speaker::volume_ {1.0f} |
|
protected |
The documentation for this class was generated from the following file:
- /opt/build/esphome/esphome/components/speaker/speaker.h