Spaces:
Running
on
Zero
Running
on
Zero
dfa
Browse files- staticfiles/aivtuber.js +5 -1
- staticfiles/livetest.html +7 -0
staticfiles/aivtuber.js
CHANGED
@@ -269,8 +269,12 @@ const handleNewLiveCommentIfNeeded = async () => {
|
|
269 |
}
|
270 |
|
271 |
const onClickSend = () => {
|
|
|
272 |
let utterance = document.querySelector("#utterance");
|
273 |
-
|
|
|
|
|
|
|
274 |
utterance.value = "";
|
275 |
}
|
276 |
|
|
|
269 |
}
|
270 |
|
271 |
const onClickSend = () => {
|
272 |
+
alert("start send")
|
273 |
let utterance = document.querySelector("#utterance");
|
274 |
+
|
275 |
+
miiboAvatar.autoRecognizeMessage(utterance)
|
276 |
+
//handleLiveComment(utterance.value, '匿名');
|
277 |
+
//onClickSend
|
278 |
utterance.value = "";
|
279 |
}
|
280 |
|
staticfiles/livetest.html
CHANGED
@@ -288,6 +288,7 @@ async getMiiboResponse(utterance) {
|
|
288 |
}
|
289 |
|
290 |
async startTalk(input) {
|
|
|
291 |
if (this.peerConnection?.signalingState === 'stable' || this.peerConnection?.iceConnectionState === 'connected') {
|
292 |
|
293 |
const gender = this.didOptions.presenter.gender;
|
@@ -345,6 +346,12 @@ async startTalk(input) {
|
|
345 |
|
346 |
try {
|
347 |
const playResponse = await this.fetchWithRetries(`https://api.d-id.com/${this.didOptions.service}/streams/${this.streamId}`, requestOptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
// Handle response if needed
|
349 |
} catch (error) {
|
350 |
console.error('Error starting talk:', error);
|
|
|
288 |
}
|
289 |
|
290 |
async startTalk(input) {
|
291 |
+
alert("start streaming id"+input)
|
292 |
if (this.peerConnection?.signalingState === 'stable' || this.peerConnection?.iceConnectionState === 'connected') {
|
293 |
|
294 |
const gender = this.didOptions.presenter.gender;
|
|
|
346 |
|
347 |
try {
|
348 |
const playResponse = await this.fetchWithRetries(`https://api.d-id.com/${this.didOptions.service}/streams/${this.streamId}`, requestOptions);
|
349 |
+
startTyping({
|
350 |
+
el: "#aiResponseUtterance",
|
351 |
+
string: input,
|
352 |
+
speed: 50
|
353 |
+
});
|
354 |
+
|
355 |
// Handle response if needed
|
356 |
} catch (error) {
|
357 |
console.error('Error starting talk:', error);
|