1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Make i2s_audio compatible with IDF 5+ (#6534)

* Update i2s_audio.cpp

Replace usage of I2S_NUM_MAX with I2S_NUM_1

* Update i2s_audio_microphone.cpp

Replace I2S_MCLK_MULTIPLE_DEFAULT with I2S_MCLK_MULTIPLE_256

* Update i2s_audio_speaker.cpp

Replace I2S_MCLK_MULTIPLE_DEFAULT with I2S_MCLK_MULTIPLE_256

* Update voice_assistant.cpp

Fix  msg.event_type format

* check SOC_I2S_NUM for c3

* use I2S_NUM_AUTO

* Update i2s_audio.cpp

* Couple tweaks

* Why did they take away I2S_NUM_MAX

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
pimdo
2024-05-28 02:42:59 +01:00
committed by GitHub
parent d2b35adcc8
commit 497cf8742f
4 changed files with 9 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
#include "esphome/core/log.h"
#include <cinttypes>
#include <cstdio>
namespace esphome {
@@ -622,7 +623,7 @@ void VoiceAssistant::signal_stop_() {
}
void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
ESP_LOGD(TAG, "Event Type: %d", msg.event_type);
ESP_LOGD(TAG, "Event Type: %" PRId32, msg.event_type);
switch (msg.event_type) {
case api::enums::VOICE_ASSISTANT_RUN_START:
ESP_LOGD(TAG, "Assist Pipeline running");
@@ -785,7 +786,7 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
this->defer([this]() { this->stt_vad_end_trigger_->trigger(); });
break;
default:
ESP_LOGD(TAG, "Unhandled event type: %d", msg.event_type);
ESP_LOGD(TAG, "Unhandled event type: %" PRId32, msg.event_type);
break;
}
}