Compare commits

...

1 Commits

Author SHA1 Message Date
raojianb
9cce0600e5 feat: task mode 2024-10-22 16:58:16 -07:00
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import type { StartAvatarResponse } from "@heygen/streaming-avatar";
import StreamingAvatar, { import StreamingAvatar, {
AvatarQuality, AvatarQuality,
StreamingEvents, TaskType, VoiceEmotion, StreamingEvents, TaskMode, TaskType, VoiceEmotion,
} from "@heygen/streaming-avatar"; } from "@heygen/streaming-avatar";
import { import {
Button, Button,
@@ -117,7 +117,7 @@ export default function InteractiveAvatar() {
return; return;
} }
// speak({ text: text, task_type: TaskType.REPEAT }) // speak({ text: text, task_type: TaskType.REPEAT })
await avatar.current.speak({ text: text }).catch((e) => { await avatar.current.speak({ text: text, taskType: TaskType.REPEAT, taskMode: TaskMode.SYNC }).catch((e) => {
setDebug(e.message); setDebug(e.message);
}); });
setIsLoadingRepeat(false); setIsLoadingRepeat(false);

View File

@@ -10,7 +10,7 @@
}, },
"dependencies": { "dependencies": {
"@ai-sdk/openai": "^0.0.34", "@ai-sdk/openai": "^0.0.34",
"@heygen/streaming-avatar": "^2.0.6", "@heygen/streaming-avatar": "^2.0.7",
"@nextui-org/button": "2.0.34", "@nextui-org/button": "2.0.34",
"@nextui-org/chip": "^2.0.32", "@nextui-org/chip": "^2.0.32",
"@nextui-org/code": "2.0.29", "@nextui-org/code": "2.0.29",