1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

Expose start to speaker interface (#5228)

This commit is contained in:
Jesse Hills
2023-08-11 16:21:44 +12:00
committed by GitHub
parent 283d9a0f5f
commit 3eef80506b
2 changed files with 3 additions and 2 deletions

View File

@@ -13,8 +13,9 @@ enum State : uint8_t {
class Speaker {
public:
virtual size_t play(const uint8_t *data, size_t length) = 0;
virtual size_t play(const std::vector<uint8_t> &data) { return this->play(data.data(), data.size()); }
size_t play(const std::vector<uint8_t> &data) { return this->play(data.data(), data.size()); }
virtual void start() = 0;
virtual void stop() = 0;
bool is_running() const { return this->state_ == STATE_RUNNING; }