fix(audio): preserve barge-in prompt across OTA
This commit is contained in:
@@ -185,10 +185,12 @@ void app_file_check_download(void)
|
|||||||
int ret = 0, cnt = 0;
|
int ret = 0, cnt = 0;
|
||||||
|
|
||||||
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
|
||||||
continue;
|
* legacy prompt download service. */
|
||||||
}
|
if(index==4||index==5||index==6||index==7||index==8||index==19){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(strlen(mp3_file[index])>0){
|
if(strlen(mp3_file[index])>0){
|
||||||
sprintf(filename_buff, "U:/%s", mp3_file[index]);
|
sprintf(filename_buff, "U:/%s", mp3_file[index]);
|
||||||
@@ -204,14 +206,16 @@ down_loop:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void app_file_check_del(void)
|
void app_file_check_del(void)
|
||||||
{
|
{
|
||||||
int index = 1;
|
int index = 1;
|
||||||
char filename_buff[64]={0x00};
|
char filename_buff[64]={0x00};
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -862,17 +862,23 @@ void sendRecordingAudioPacket(AudioPacket *packet) {
|
|||||||
|
|
||||||
extern const char *mp3_file[];
|
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(power_down_status!=1){
|
// if(xiaoice_get_tts_play_status() || get_start_mic_flag()==1) return -1;
|
||||||
if(vad_audio_is_recording() || tts_playing!=0 || fota_start==1 || power_down_status==2 || get_sleep_mode()==1) return -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) {
|
||||||
|
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,11 +887,14 @@ 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);
|
||||||
file_valid_check = 1;
|
if(access_ret==0){
|
||||||
}else{
|
file_valid_check = 1;
|
||||||
file_valid_check = 2;
|
}else{
|
||||||
}
|
printf("tips file missing:index=%d path=%s access=%d\r\n",
|
||||||
|
index, filename_buff, access_ret);
|
||||||
|
file_valid_check = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_valid_check!=2){
|
if(file_valid_check!=2){
|
||||||
|
|||||||
Reference in New Issue
Block a user