1
0
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:
J. Nick Koston
2025-07-21 11:38:39 -10:00
committed by GitHub
parent 74ce3d2c0b
commit db62a94712
9 changed files with 154 additions and 108 deletions

View File

@@ -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_) {