Update music player
This commit is contained in:
@@ -759,9 +759,14 @@ void Esp32Music::PlayAudioStream() {
|
||||
auto& app = Application::GetInstance();
|
||||
DeviceState current_state = app.GetDeviceState();
|
||||
|
||||
// 等小智把话说完了,变成聆听状态之后,马上转成待机状态,进入音乐播放
|
||||
if (current_state == kDeviceStateListening) {
|
||||
ESP_LOGI(TAG, "Device is in listening state, switching to idle state for music playback");
|
||||
// 状态转换:说话中-》聆听中-》待机状态-》播放音乐
|
||||
if (current_state == kDeviceStateListening || current_state == kDeviceStateSpeaking) {
|
||||
if (current_state == kDeviceStateSpeaking) {
|
||||
ESP_LOGI(TAG, "Device is in speaking state, switching to listening state for music playback");
|
||||
}
|
||||
if (current_state == kDeviceStateListening) {
|
||||
ESP_LOGI(TAG, "Device is in listening state, switching to idle state for music playback");
|
||||
}
|
||||
// 切换状态
|
||||
app.ToggleChatState(); // 变成待机状态
|
||||
vTaskDelay(pdMS_TO_TICKS(300));
|
||||
|
||||
Reference in New Issue
Block a user