| | |
| | | #include "system.h" |
| | | #include "config.h" |
| | | #include "app_task.h" |
| | | #include "display/lvgl_display/jpg/jpeg_to_image.h" |
| | | |
| | | #include <esp_heap_caps.h> |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | |
| | | 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(); |
| | |
| | | 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)); |