|
|
@@ -3,9 +3,7 @@ package midware.service.eslclient;
|
|
3
|
3
|
import com.alibaba.fastjson2.JSON;
|
|
4
|
4
|
import lombok.extern.slf4j.Slf4j;
|
|
5
|
5
|
import midware.entity.database.rep.Ai;
|
|
6
|
|
-import midware.service.eslclient.entity.Channel;
|
|
7
|
6
|
import midware.service.init.EslClientService;
|
|
8
|
|
-import midware.service.rep.IConfigService;
|
|
9
|
7
|
import midware.util.enums.EslEventEnum;
|
|
10
|
8
|
import midware.util.helper.HttpHelper;
|
|
11
|
9
|
import midware.util.helper.SpringHelper;
|
|
|
@@ -47,21 +45,18 @@ public class EslEventListenerAi implements IEslEventListener {
|
|
47
|
45
|
} else {
|
|
48
|
46
|
switch (EslEventEnum.valueOf(eventname)) {
|
|
49
|
47
|
case CHANNEL_ANSWER:
|
|
50
|
|
- //是否开启语音识别
|
|
51
|
|
- if (SpringHelper.getBean(IConfigService.class).getConfigValue("EnableAsr").equals("1")) {
|
|
52
|
|
- //开启语音识别
|
|
53
|
|
- String type = SpringHelper.getRequiredProperty("common.asr");
|
|
54
|
|
- switch (type) {
|
|
55
|
|
- case "funasr":
|
|
56
|
|
- eslClientService.funasr(chanId, true);
|
|
57
|
|
- break;
|
|
58
|
|
- case "mrcp":
|
|
59
|
|
- eslClientService.appCommand(chanId, "set", "fire_asr_events=true");
|
|
60
|
|
- eslClientService.appCommand(chanId, "detect_speech", "unimrcp:mrcpv2 hello hello");
|
|
61
|
|
- break;
|
|
62
|
|
- }
|
|
63
|
|
- eslClientService.playBack("/home/wav/zyyt/欢迎词.wav", chanId);
|
|
|
48
|
+ //开启语音识别
|
|
|
49
|
+ String type = SpringHelper.getRequiredProperty("common.asr");
|
|
|
50
|
+ switch (type) {
|
|
|
51
|
+ case "funasr":
|
|
|
52
|
+ eslClientService.funasr(chanId, true);
|
|
|
53
|
+ break;
|
|
|
54
|
+ case "mrcp":
|
|
|
55
|
+ eslClientService.appCommand(chanId, "set", "fire_asr_events=true");
|
|
|
56
|
+ eslClientService.appCommand(chanId, "detect_speech", "unimrcp:mrcpv2 hello hello");
|
|
|
57
|
+ break;
|
|
64
|
58
|
}
|
|
|
59
|
+ eslClientService.playBack("/home/wav/zyyt/欢迎词.wav", chanId);
|
|
65
|
60
|
break;
|
|
66
|
61
|
case DETECTED_SPEECH://mrcp
|
|
67
|
62
|
String speechType = header.get("Speech-Type");
|