mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
some extra fixes
This commit is contained in:
parent
a671507be6
commit
4e03bb977e
3 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,7 @@ AudioStreamer *AudioListener::start(const AudioStreamInfo &audio_stream_info) {
|
|||
return nullptr;
|
||||
}
|
||||
if (this->starting(audio_stream_info)) {
|
||||
this->current_streamer_ = new AudioStreamer();
|
||||
this->current_streamer_ = new AudioStreamer(); // NOLINT(cppcoreguidelines-owning-memory)
|
||||
this->current_streamer_->set_parent(this);
|
||||
}
|
||||
return nullptr;
|
||||
|
|
|
@ -20,13 +20,13 @@ template<typename... Ts> class PlayAction : public Action<Ts...>, public Parente
|
|||
}
|
||||
|
||||
void play(Ts... x) override {
|
||||
auto val = this->data_func_(x...);
|
||||
auto val = data_static_;
|
||||
|
||||
if (!this->static_) {
|
||||
val = this->data_func_(x...);
|
||||
}
|
||||
auto streamer = this->parent_->start();
|
||||
streamer->stream(val);
|
||||
streamer->stream(val.data(), val.size());
|
||||
delete streamer;
|
||||
}
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ void VoiceAssistant::write_speaker_() {
|
|||
if ((this->speaker_ != nullptr) && (this->speaker_buffer_ != nullptr)) {
|
||||
if (this->speaker_buffer_size_ > 0) {
|
||||
size_t write_chunk = std::min<size_t>(this->speaker_buffer_size_, 4 * 1024);
|
||||
size_t written = this->speaker_->play(this->speaker_buffer_, write_chunk);
|
||||
size_t written = 0; // this->speaker_->play(this->speaker_buffer_, write_chunk);
|
||||
if (written > 0) {
|
||||
memmove(this->speaker_buffer_, this->speaker_buffer_ + written, this->speaker_buffer_size_ - written);
|
||||
this->speaker_buffer_size_ -= written;
|
||||
|
|
Loading…
Reference in a new issue