Spaces:
Running
on
Zero
Running
on
Zero
test
Browse files- staticfiles/livetest.html +13 -7
staticfiles/livetest.html
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
<video id="my-video" autoplay></video>
|
24 |
|
25 |
<script>
|
26 |
-
|
27 |
'use strict';
|
28 |
class MiiboAvatar {
|
29 |
constructor(config) {
|
@@ -51,7 +51,8 @@ initialize() {
|
|
51 |
}
|
52 |
|
53 |
async createNewStream() {
|
54 |
-
|
|
|
55 |
try {
|
56 |
this.stopAllStreams();
|
57 |
this.closePC();
|
@@ -163,7 +164,8 @@ autoRecognizeMessage(message) {
|
|
163 |
|
164 |
//handleLiveComment("test",message)
|
165 |
//live2d
|
166 |
-
|
|
|
167 |
this.rec.continuous = false
|
168 |
this.rec.interimResults = false
|
169 |
this.rec.lang = 'ja-JP'
|
@@ -199,7 +201,8 @@ autoRecognize() {
|
|
199 |
this.playLoadingVideo();
|
200 |
|
201 |
this.rec.stop()
|
202 |
-
|
|
|
203 |
|
204 |
for (var i = e.resultIndex; i < e.results.length; i++) {
|
205 |
if (!e.results[i].isFinal) continue
|
@@ -233,13 +236,15 @@ arrayBufferToBase64(buffer) {
|
|
233 |
|
234 |
ask(message) {
|
235 |
//youtubeからの質問
|
236 |
-
|
|
|
237 |
//ask(start);
|
238 |
this.getMiiboResponse(message);
|
239 |
}
|
240 |
|
241 |
async getMiiboResponse(utterance) {
|
242 |
-
|
|
|
243 |
const params = {
|
244 |
api_key: this.miiboOptions.api_key,
|
245 |
agent_id: this.miiboOptions.agent_id,
|
@@ -292,7 +297,8 @@ async getMiiboResponse(utterance) {
|
|
292 |
}
|
293 |
|
294 |
async startTalk(input) {
|
295 |
-
|
|
|
296 |
if (this.peerConnection?.signalingState === 'stable' || this.peerConnection?.iceConnectionState === 'connected') {
|
297 |
|
298 |
const gender = this.didOptions.presenter.gender;
|
|
|
23 |
<video id="my-video" autoplay></video>
|
24 |
|
25 |
<script>
|
26 |
+
let _debug = 1;
|
27 |
'use strict';
|
28 |
class MiiboAvatar {
|
29 |
constructor(config) {
|
|
|
51 |
}
|
52 |
|
53 |
async createNewStream() {
|
54 |
+
if(_debug==1)
|
55 |
+
alert("53")
|
56 |
try {
|
57 |
this.stopAllStreams();
|
58 |
this.closePC();
|
|
|
164 |
|
165 |
//handleLiveComment("test",message)
|
166 |
//live2d
|
167 |
+
if(_debug==1)
|
168 |
+
alert("start word test")
|
169 |
this.rec.continuous = false
|
170 |
this.rec.interimResults = false
|
171 |
this.rec.lang = 'ja-JP'
|
|
|
201 |
this.playLoadingVideo();
|
202 |
|
203 |
this.rec.stop()
|
204 |
+
if(_debug==1)
|
205 |
+
alert("start")
|
206 |
|
207 |
for (var i = e.resultIndex; i < e.results.length; i++) {
|
208 |
if (!e.results[i].isFinal) continue
|
|
|
236 |
|
237 |
ask(message) {
|
238 |
//youtubeからの質問
|
239 |
+
if(_debug==1)
|
240 |
+
alert("203 ask ========================== "+message);
|
241 |
//ask(start);
|
242 |
this.getMiiboResponse(message);
|
243 |
}
|
244 |
|
245 |
async getMiiboResponse(utterance) {
|
246 |
+
if(_debug==1)
|
247 |
+
alert("209 getMiiboResponse"+utterance)
|
248 |
const params = {
|
249 |
api_key: this.miiboOptions.api_key,
|
250 |
agent_id: this.miiboOptions.agent_id,
|
|
|
297 |
}
|
298 |
|
299 |
async startTalk(input) {
|
300 |
+
if(_debug==1)
|
301 |
+
alert("start streaming id==============="+input)
|
302 |
if (this.peerConnection?.signalingState === 'stable' || this.peerConnection?.iceConnectionState === 'connected') {
|
303 |
|
304 |
const gender = this.didOptions.presenter.gender;
|