disable yunxin && change wake up words

This commit is contained in:
wangzijiao 2018-09-14 11:17:00 +08:00
parent 0e4649dec4
commit d27d8a5821
2 changed files with 23 additions and 8 deletions
app/netease_voice_common_module/src

View File

@ -32,7 +32,7 @@ extern "C" {
#define USED_NETEASE_DUILITE (1)
#define USED_NETEASE_DUILITE_VAD (1)
#define USED_XUNFEI_CAE (0)
#define ENABLE_YUNXIN
//#define ENABLE_YUNXIN
#if USED_NETEASE_FMAE
#include <fmae/fmae.h>

View File

@ -183,7 +183,7 @@ int Duilite_wakeup_cb(void *userdata, int type, char *msg, int len) {
double confidence;
been_wakedup = 1;
n_toast("Wake up:%s\n", msg);
n_toast("Wake up::%s\n", msg);
setAng(-1);
Netease_IAT_checkflag(1);
@ -199,21 +199,36 @@ int Duilite_wakeup_cb(void *userdata, int type, char *msg, int len) {
"major", &major, "status", &status, "confidence",
&confidence);
setVoiceWakeupword(wakeupword);
n_toast("json ok, wakeupword:%s\n", wakeupword);
sprintf(tmp,
"{\"wakeupwords\":\"%s\",\"angle\":%d,\"score\":%d,\"beam\":%d,"
"\"power\":%f}",
wakeupword, 1, 1, 1, 1.1);
setVoiceConfidence(confidence);
setVoiceMajor(major);
setVoiceStatus(status);
json_decref(js);
} else {
n_toast("Wake up json err\n");
sprintf(tmp, "{\"angle\":%d,\"score\":%d,\"beam\":%d,\"power\":%f}", 1,
1, 1, 1.2);
}
sprintf(tmp, "{\"angle\":%d,\"score\":%d,\"beam\":%d,\"power\":%f}", 1, 1,
1, 1.1);
n_toast("Send to cc:%s\n", tmp);
Netease_Dbus_Send_CMD(MODULE_VOICEENGINE, MODULE_CONTROLLER,
CMD_MSC_MSG_CONTROLLER_WAKEUP, tmp, strlen(tmp));
}
static char* g_pQuickWkKey[] =
{
"xia yi shou",
"da sheng yi dian",
"xiao sheng yi dian",
};
int Duilite_doa_cb(void *userdata, int type, char *msg, int len) {
json_t *tmp;
json_t *js;
n_toast("Dao cb:%s\n", msg);
n_toast("Doa cb:%s, wakeup by: %s\n", msg, getVoiceWakeupword());
if (NULL == msg || len <= 0) {
return 0;
}
@ -759,7 +774,7 @@ void main(int argc, char **argv) {
}
#ifdef ENABLE_YUNXIN
// Netease_yunxin_init(&audiobypassconfig);
Netease_yunxin_init(&audiobypassconfig);
#endif
// Netease_Dbus_Start_Sync();
@ -790,8 +805,8 @@ void main(int argc, char **argv) {
while (1) {
if (strlen(getUuid()) == 0 || strlen(getYxToken()) == 0) {
// n_toast("Get args frome cc\n");
// Netease_dbus_initargs();
n_toast("Get args frome cc\n");
Netease_dbus_initargs();
usleep(1000000);
} else {
break;