wangzhibo
2026-08-31 17ac2ce0ed52874616c79c910667e41e34604826
xiaozhi-esp32-2.2.6/main/boards/sening-xiaozhi-s3/system.c
@@ -1,5 +1,6 @@
#include "system.h"
#include "config.h"
#include "app_task.h"
#include "display/lvgl_display/jpg/jpeg_to_image.h"
#include <esp_heap_caps.h>
@@ -130,11 +131,15 @@
    if (!command || Board_Is_Power_Off()) {
        return false;
    }
    if (Board_Handle_Voice_Command(command)) {
        return true;
    }
    if (strcmp(command, OFFLINE_COMMAND_WORD) != 0 && strcmp(command, OFFLINE_COMMAND_WORD_PINYIN) != 0) {
        return false;
    }
    Board_Offline_Command_Callback();
    Board_EnterVoiceEntry();
    return true;
}
@@ -547,6 +552,11 @@
esp_err_t SDCard_Play_MP3_With_Speed(char *mp3_name, float speed)
{
    return SDCard_Play_MP3_With_Speed_Repeat(mp3_name, speed, 1, false);
}
esp_err_t SDCard_Play_MP3_With_Speed_Repeat(char *mp3_name, float speed, int repeat, bool power_off_after)
{
    if (!is_supported_mp3_speed(speed)) {
        ESP_LOGW(TAG, "invalid MP3 playback speed: %.2f", speed);
        SDCard_Resume_Play();
@@ -560,7 +570,7 @@
        return ESP_ERR_NOT_FOUND;
    }
    esp_err_t err = SDCard_Play_MP3_File_With_Speed(path, speed);
    esp_err_t err = SDCard_Play_MP3_File_With_Speed_Repeat(path, speed, repeat, power_off_after);
    if (err != ESP_OK) {
        SDCard_Resume_Play();
        ESP_LOGE(TAG, "start MP3 playback failed: %s", esp_err_to_name(err));