fix(audio): preserve barge-in prompt across OTA
This commit is contained in:
@@ -186,7 +186,9 @@ void app_file_check_download(void)
|
|||||||
|
|
||||||
for(index=1;index<20;index++){
|
for(index=1;index<20;index++){
|
||||||
|
|
||||||
if(index==4||index==5||index==6||index==7||index==8){
|
/* barge_in_cute.mp3 is shipped in customer_fs and is not hosted by the
|
||||||
|
* legacy prompt download service. */
|
||||||
|
if(index==4||index==5||index==6||index==7||index==8||index==19){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +213,9 @@ void app_file_check_del(void)
|
|||||||
|
|
||||||
for(index=1;index<20;index++){
|
for(index=1;index<20;index++){
|
||||||
|
|
||||||
if(index==4||index==5||index==6||index==7||index==8){
|
/* Keep the bundled barge-in prompt across app-only FOTA. Unlike the
|
||||||
|
* server-managed prompts, it cannot be restored by the downloader. */
|
||||||
|
if(index==4||index==5||index==6||index==7||index==8||index==19){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -865,13 +865,19 @@ extern const char *mp3_file[];
|
|||||||
int app_play_tips_file(int index)
|
int app_play_tips_file(int index)
|
||||||
{
|
{
|
||||||
int file_valid_check = 0;
|
int file_valid_check = 0;
|
||||||
|
int access_ret = 0;
|
||||||
|
|
||||||
printf("xiaoice_play_index:%d\n", index);
|
printf("xiaoice_play_index:%d\n", index);
|
||||||
|
|
||||||
//正在录音过程中不允许播放
|
//正在录音过程中不允许播放
|
||||||
// if(xiaoice_get_tts_play_status() || get_start_mic_flag()==1) return -1;
|
// if(xiaoice_get_tts_play_status() || get_start_mic_flag()==1) return -1;
|
||||||
if(power_down_status!=1){
|
if(power_down_status!=1){
|
||||||
if(vad_audio_is_recording() || tts_playing!=0 || fota_start==1 || power_down_status==2 || get_sleep_mode()==1) return -1;
|
if(vad_audio_is_recording() || tts_playing!=0 || fota_start==1 || power_down_status==2 || get_sleep_mode()==1) {
|
||||||
|
printf("tips blocked:index=%d vad=%d tts=%d fota=%d power=%d sleep=%d\r\n",
|
||||||
|
index, vad_audio_is_recording(), tts_playing, fota_start,
|
||||||
|
power_down_status, get_sleep_mode());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char filename_buff[64]={0x00};
|
char filename_buff[64]={0x00};
|
||||||
@@ -881,9 +887,12 @@ int app_play_tips_file(int index)
|
|||||||
if(index==0) {
|
if(index==0) {
|
||||||
file_valid_check = 0;
|
file_valid_check = 0;
|
||||||
}else{
|
}else{
|
||||||
if(ql_access(filename_buff, 0)==0){
|
access_ret = ql_access(filename_buff, 0);
|
||||||
|
if(access_ret==0){
|
||||||
file_valid_check = 1;
|
file_valid_check = 1;
|
||||||
}else{
|
}else{
|
||||||
|
printf("tips file missing:index=%d path=%s access=%d\r\n",
|
||||||
|
index, filename_buff, access_ret);
|
||||||
file_valid_check = 2;
|
file_valid_check = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user