// Return 1: success.
// 添加识别关键词语,开发者可以学习"语音识别芯片LD3320高阶秘籍.pdf"中关于垃圾词语吸收错误的用法
u8 ld3320_asr_addFixed()
{
u8 k, flag;
u8 nAsrAddLength;
const char sRecog[24][30] = {"xiao hui hui",
"ni you xi fu mei",
"jiang ge gu shi",
"ni shi bu shi dan teng",
"ni ban ben hao duo shao",
"jin tian duo shao hao",
"jin tian ji hao le",
"xian zai ji dian le",
"jin nian ji sui le",
"ni sheng wa le mei",
"da kai ji dian qi yi",
"da kai ji dian qi er",
"guan bi ji dian qi yi",
"guan bi ji dian qi er",
"da kai suo you ji dian qi",
"guan bi suo you ji dian qi",
"tiao gao yin liang",
"zeng jia tin liang",
"tiao xiao yin liang",
"jiang di yin lliang",
"tiao gao yu su",
"zeng jia yu su",
"tiao xiao yu su",
"jiang di yu su",
};
const Order pCode[24] = {
name,
wife,
speakStore,
eggPain,
visionNum,
todayDate,
whyToday,
whatTime,
howOld,
haveChild,
openRelayOne,
openRelayTwo,
closeRelayOne,
closeRelayTwo,
openRelay,
closeRelay,
upVolume,
upVolume,
downVolume,
downVolume,
upSpeed,
upSpeed,
downSpeed,
downSpeed,
};
flag = 1;
for (k=0; k<24; k++)
{
if(ld3320_check_asrbusyflag_b2() == 0)
{
flag = 0;
break;
}
ld3320_write_reg(0xc1, pCode[k] );
ld3320_write_reg(0xc3, 0 );
ld3320_write_reg(0x08, 0x04);
delay_ms(1);
ld3320_write_reg(0x08, 0x00);
delay_ms(1);
for (nAsrAddLength=0; nAsrAddLength<30; nAsrAddLength++)
{
if (sRecog[k][nAsrAddLength] == 0)
break;
ld3320_write_reg(0x5, sRecog[k][nAsrAddLength]);
}
ld3320_write_reg(0xb9, nAsrAddLength);
ld3320_write_reg(0xb2, 0xff);
ld3320_write_reg(0x37, 0x04);
}
return flag;
}
u8 ld3320_get_result()
{
return ld3320_read_reg(0xc5 );
}
|