mirror of
https://github.com/esphome/esphome.git
synced 2025-09-28 08:02:23 +01:00
[api] Implement zero-copy for all protobuf bytes fields (#9761)
This commit is contained in:
@@ -273,7 +273,7 @@ void VoiceAssistant::loop() {
|
||||
size_t read_bytes = this->ring_buffer_->read((void *) this->send_buffer_, SEND_BUFFER_SIZE, 0);
|
||||
if (this->audio_mode_ == AUDIO_MODE_API) {
|
||||
api::VoiceAssistantAudio msg;
|
||||
msg.data.assign((char *) this->send_buffer_, read_bytes);
|
||||
msg.set_data(this->send_buffer_, read_bytes);
|
||||
this->api_client_->send_message(msg, api::VoiceAssistantAudio::MESSAGE_TYPE);
|
||||
} else {
|
||||
if (!this->udp_socket_running_) {
|
||||
|
Reference in New Issue
Block a user