|
|
@@ -1,31 +1,4 @@
|
|
1
|
1
|
|
|
2
|
|
-var clientChatHtml = ''
|
|
3
|
|
-var serviceChatHtml = ''
|
|
4
|
|
-var objVoice ={
|
|
5
|
|
- agent_id:'8000',
|
|
6
|
|
- timestamp:new Date().getTime(),
|
|
7
|
|
- data:''
|
|
8
|
|
-}
|
|
9
|
|
-//VoiceCommAPI.setConfigureServer("http://配置服务器 URL");
|
|
10
|
|
-//var agent = VoiceCommAPI.createAgentControl();
|
|
11
|
|
-//agent.login(objVoice);
|
|
12
|
|
-//agent.setDetectSpeechEventListener(objVoice,function(data){})
|
|
13
|
|
-//agent.on('setDetectSpeechEventListener',function(data){})
|
|
14
|
|
-
|
|
15
|
|
-setTimeout(function(){
|
|
16
|
|
-
|
|
17
|
|
- for(var i = 0; i < voiceToTextContextAway.length; i++) {
|
|
18
|
|
- if (voiceToTextContextAway[i].type=="clientChat") {
|
|
19
|
|
- $('<div class="clientChat"><img src="img/youkeTx.png"><div class="clientChatText">'+
|
|
20
|
|
- voiceToTextContextAway[i].clientChat+'</div></div>').appendTo($(".voiceToTextContext"));
|
|
21
|
|
- } else if(voiceToTextContextAway[i].type=="serviceChat"){
|
|
22
|
|
- $('<div class="serviceChat"><img src="img/kefuTx.png"><div class="serviceChatText">'+
|
|
23
|
|
- voiceToTextContextAway[i].serviceChat+'</div></div>').appendTo($(".voiceToTextContext"));
|
|
24
|
|
- }
|
|
25
|
|
- }
|
|
26
|
|
-
|
|
27
|
|
- scrollTopFn("scrollVoice")
|
|
28
|
|
-},2000)
|
|
29
|
2
|
$("#clickElementVoice").click(function(){
|
|
30
|
3
|
var elThis = $(this)
|
|
31
|
4
|
voiceTextToggle(elThis,1000)
|
|
|
@@ -62,101 +35,129 @@ function showFn(el,timeToggle){
|
|
62
|
35
|
timeoutShow= null
|
|
63
|
36
|
},timeToggle)
|
|
64
|
37
|
}
|
|
65
|
|
-var voiceToTextContextAway = [
|
|
66
|
|
- {
|
|
67
|
|
- type:"clientChat",
|
|
68
|
|
- clientChat:'你知道2020年我最宝贵的是什么吗'
|
|
69
|
|
- },
|
|
70
|
|
- {
|
|
71
|
|
- type:"serviceChat",
|
|
72
|
|
- serviceChat:'什么哟'
|
|
73
|
|
- },
|
|
74
|
|
- {
|
|
75
|
|
- type:"clientChat",
|
|
76
|
|
- clientChat:'我刚说的那句话的第一个字'
|
|
77
|
|
- },
|
|
78
|
|
- {
|
|
79
|
|
- type:"clientChat",
|
|
80
|
|
- clientChat:'啊 我的心好痛'
|
|
81
|
|
- },
|
|
82
|
|
- {
|
|
83
|
|
- type:"serviceChat",
|
|
84
|
|
- serviceChat:'怎么了'
|
|
85
|
|
- },
|
|
86
|
|
- {
|
|
87
|
|
- type:"clientChat",
|
|
88
|
|
- clientChat:'你卡在我心上了'
|
|
89
|
|
- },
|
|
90
|
|
- {
|
|
91
|
|
- type:"clientChat",
|
|
92
|
|
- clientChat:'我第一次见到你我就发烧了'
|
|
93
|
|
- },
|
|
94
|
|
- {
|
|
95
|
|
- type:"serviceChat",
|
|
96
|
|
- serviceChat:'为什么'
|
|
97
|
|
- },
|
|
98
|
|
- {
|
|
99
|
|
- type:"clientChat",
|
|
100
|
|
- clientChat:'因为一见钟情的体温是38°6啊'
|
|
101
|
|
- },
|
|
102
|
|
- {
|
|
103
|
|
- type:"clientChat",
|
|
104
|
|
- clientChat:'你知道我现在最想喝什么吗?'
|
|
105
|
|
- },
|
|
106
|
|
- {
|
|
107
|
|
- type:"serviceChat",
|
|
108
|
|
- serviceChat:'喝什么?'
|
|
109
|
|
- },
|
|
110
|
|
- {
|
|
111
|
|
- type:"clientChat",
|
|
112
|
|
- clientChat:'呵护你。'
|
|
113
|
|
- },
|
|
114
|
|
- {
|
|
115
|
|
- type:"clientChat",
|
|
116
|
|
- clientChat:'我觉得我好像见过你'
|
|
117
|
|
- },
|
|
118
|
|
- {
|
|
119
|
|
- type:"serviceChat",
|
|
120
|
|
- serviceChat:'在哪?'
|
|
121
|
|
- },
|
|
122
|
|
- {
|
|
123
|
|
- type:"clientChat",
|
|
124
|
|
- clientChat:'在我的结婚证上'
|
|
125
|
|
- },
|
|
126
|
|
- {
|
|
127
|
|
- type:"clientChat",
|
|
128
|
|
- clientChat:'你喜欢吃糖吗'
|
|
129
|
|
- },
|
|
130
|
|
- {
|
|
131
|
|
- type:"serviceChat",
|
|
132
|
|
- serviceChat:'不喜欢'
|
|
133
|
|
- },
|
|
134
|
|
- {
|
|
135
|
|
- type:"clientChat",
|
|
136
|
|
- clientChat:'那为什么你还这么甜'
|
|
137
|
|
- },
|
|
138
|
|
- {
|
|
139
|
|
- type:"clientChat",
|
|
140
|
|
- clientChat:'你跑的快吗?'
|
|
141
|
|
- },
|
|
142
|
|
- {
|
|
143
|
|
- type:"serviceChat",
|
|
144
|
|
- serviceChat:'不太快。'
|
|
145
|
|
- },
|
|
146
|
|
- {
|
|
147
|
|
- type:"clientChat",
|
|
148
|
|
- clientChat:'那太好了,我一定能追到你。'
|
|
149
|
|
- },
|
|
150
|
|
- {
|
|
151
|
|
- type:"clientChat",
|
|
152
|
|
- clientChat:'有一个很美的故事'
|
|
153
|
|
- },
|
|
154
|
|
- {
|
|
155
|
|
- type:"serviceChat",
|
|
156
|
|
- serviceChat:'什么故事'
|
|
157
|
|
- },
|
|
158
|
|
- {
|
|
159
|
|
- type:"clientChat",
|
|
160
|
|
- clientChat:'就是你遇见我的事'
|
|
161
|
|
- },
|
|
162
|
|
-]
|
|
|
38
|
+
|
|
|
39
|
+//var clientChatHtml = ''
|
|
|
40
|
+//var serviceChatHtml = ''
|
|
|
41
|
+//var objVoice ={
|
|
|
42
|
+// agent_id:'8000',
|
|
|
43
|
+// timestamp:new Date().getTime(),
|
|
|
44
|
+// data:''
|
|
|
45
|
+//}
|
|
|
46
|
+//VoiceCommAPI.setConfigureServer("ws://222.143.106.46:12233");
|
|
|
47
|
+//var agent = VoiceCommAPI.createAgentControl();
|
|
|
48
|
+//agent.login(objVoice);
|
|
|
49
|
+//agent.setDetectSpeechEventListener(objVoice,function(data){})
|
|
|
50
|
+//agent.on('setDetectSpeechEventListener',function(data){})
|
|
|
51
|
+
|
|
|
52
|
+//setTimeout(function(){
|
|
|
53
|
+//
|
|
|
54
|
+// for(var i = 0; i < voiceToTextContextAway.length; i++) {
|
|
|
55
|
+// if (voiceToTextContextAway[i].type=="clientChat") {
|
|
|
56
|
+// $('<div class="clientChat"><img src="img/youkeTx.png"><div class="clientChatText">'+
|
|
|
57
|
+// voiceToTextContextAway[i].clientChat+'</div></div>').appendTo($(".voiceToTextContext"));
|
|
|
58
|
+// } else if(voiceToTextContextAway[i].type=="serviceChat"){
|
|
|
59
|
+// $('<div class="serviceChat"><img src="img/kefuTx.png"><div class="serviceChatText">'+
|
|
|
60
|
+// voiceToTextContextAway[i].serviceChat+'</div></div>').appendTo($(".voiceToTextContext"));
|
|
|
61
|
+// }
|
|
|
62
|
+// }
|
|
|
63
|
+//
|
|
|
64
|
+//
|
|
|
65
|
+//},2000)
|
|
|
66
|
+//var voiceToTextContextAway = [
|
|
|
67
|
+// {
|
|
|
68
|
+// type:"clientChat",
|
|
|
69
|
+// clientChat:'你知道2020年我最宝贵的是什么吗'
|
|
|
70
|
+// },
|
|
|
71
|
+// {
|
|
|
72
|
+// type:"serviceChat",
|
|
|
73
|
+// serviceChat:'什么哟'
|
|
|
74
|
+// },
|
|
|
75
|
+// {
|
|
|
76
|
+// type:"clientChat",
|
|
|
77
|
+// clientChat:'我刚说的那句话的第一个字'
|
|
|
78
|
+// },
|
|
|
79
|
+// {
|
|
|
80
|
+// type:"clientChat",
|
|
|
81
|
+// clientChat:'啊 我的心好痛'
|
|
|
82
|
+// },
|
|
|
83
|
+// {
|
|
|
84
|
+// type:"serviceChat",
|
|
|
85
|
+// serviceChat:'怎么了'
|
|
|
86
|
+// },
|
|
|
87
|
+// {
|
|
|
88
|
+// type:"clientChat",
|
|
|
89
|
+// clientChat:'你卡在我心上了'
|
|
|
90
|
+// },
|
|
|
91
|
+// {
|
|
|
92
|
+// type:"clientChat",
|
|
|
93
|
+// clientChat:'我第一次见到你我就发烧了'
|
|
|
94
|
+// },
|
|
|
95
|
+// {
|
|
|
96
|
+// type:"serviceChat",
|
|
|
97
|
+// serviceChat:'为什么'
|
|
|
98
|
+// },
|
|
|
99
|
+// {
|
|
|
100
|
+// type:"clientChat",
|
|
|
101
|
+// clientChat:'因为一见钟情的体温是38°6啊'
|
|
|
102
|
+// },
|
|
|
103
|
+// {
|
|
|
104
|
+// type:"clientChat",
|
|
|
105
|
+// clientChat:'你知道我现在最想喝什么吗?'
|
|
|
106
|
+// },
|
|
|
107
|
+// {
|
|
|
108
|
+// type:"serviceChat",
|
|
|
109
|
+// serviceChat:'喝什么?'
|
|
|
110
|
+// },
|
|
|
111
|
+// {
|
|
|
112
|
+// type:"clientChat",
|
|
|
113
|
+// clientChat:'呵护你。'
|
|
|
114
|
+// },
|
|
|
115
|
+// {
|
|
|
116
|
+// type:"clientChat",
|
|
|
117
|
+// clientChat:'我觉得我好像见过你'
|
|
|
118
|
+// },
|
|
|
119
|
+// {
|
|
|
120
|
+// type:"serviceChat",
|
|
|
121
|
+// serviceChat:'在哪?'
|
|
|
122
|
+// },
|
|
|
123
|
+// {
|
|
|
124
|
+// type:"clientChat",
|
|
|
125
|
+// clientChat:'在我的结婚证上'
|
|
|
126
|
+// },
|
|
|
127
|
+// {
|
|
|
128
|
+// type:"clientChat",
|
|
|
129
|
+// clientChat:'你喜欢吃糖吗'
|
|
|
130
|
+// },
|
|
|
131
|
+// {
|
|
|
132
|
+// type:"serviceChat",
|
|
|
133
|
+// serviceChat:'不喜欢'
|
|
|
134
|
+// },
|
|
|
135
|
+// {
|
|
|
136
|
+// type:"clientChat",
|
|
|
137
|
+// clientChat:'那为什么你还这么甜'
|
|
|
138
|
+// },
|
|
|
139
|
+// {
|
|
|
140
|
+// type:"clientChat",
|
|
|
141
|
+// clientChat:'你跑的快吗?'
|
|
|
142
|
+// },
|
|
|
143
|
+// {
|
|
|
144
|
+// type:"serviceChat",
|
|
|
145
|
+// serviceChat:'不太快。'
|
|
|
146
|
+// },
|
|
|
147
|
+// {
|
|
|
148
|
+// type:"clientChat",
|
|
|
149
|
+// clientChat:'那太好了,我一定能追到你。'
|
|
|
150
|
+// },
|
|
|
151
|
+// {
|
|
|
152
|
+// type:"clientChat",
|
|
|
153
|
+// clientChat:'有一个很美的故事'
|
|
|
154
|
+// },
|
|
|
155
|
+// {
|
|
|
156
|
+// type:"serviceChat",
|
|
|
157
|
+// serviceChat:'什么故事'
|
|
|
158
|
+// },
|
|
|
159
|
+// {
|
|
|
160
|
+// type:"clientChat",
|
|
|
161
|
+// clientChat:'就是你遇见我的事'
|
|
|
162
|
+// },
|
|
|
163
|
+//]
|