Compare commits
1 Commits
main
...
feat/simpl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64bb29760e |
@@ -110,7 +110,7 @@ export default function InteractiveAvatar() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await avatar.current
|
await avatar.current
|
||||||
.speak({ text: text, sessionId: data?.session_id! })
|
.speak({ text: text })
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
setDebug(e.message);
|
setDebug(e.message);
|
||||||
});
|
});
|
||||||
@@ -123,7 +123,7 @@ export default function InteractiveAvatar() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await avatar.current
|
await avatar.current
|
||||||
.interrupt({ sessionId: data?.session_id! })
|
.interrupt()
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
setDebug(e.message);
|
setDebug(e.message);
|
||||||
});
|
});
|
||||||
@@ -134,9 +134,7 @@ export default function InteractiveAvatar() {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await avatar.current.stopAvatar({
|
await avatar.current.stopAvatar();
|
||||||
sessionId: data?.session_id!,
|
|
||||||
});
|
|
||||||
setStream(undefined);
|
setStream(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,9 +153,9 @@ export default function InteractiveAvatar() {
|
|||||||
const previousText = usePrevious(text);
|
const previousText = usePrevious(text);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!previousText && text) {
|
if (!previousText && text) {
|
||||||
avatar.current?.startListening({ sessionId: data?.session_id! });
|
avatar.current?.startListening();
|
||||||
} else if (previousText && !text) {
|
} else if (previousText && !text) {
|
||||||
avatar?.current?.stopListening({ sessionId: data?.session_id! });
|
avatar?.current?.stopListening();
|
||||||
}
|
}
|
||||||
}, [text, previousText]);
|
}, [text, previousText]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user