@omote/babylon 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,11 +59,12 @@ Full-featured avatar class with CharacterController (compositor + gaze + life la
|
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
61
|
import { OmoteAvatar } from '@omote/babylon';
|
|
62
|
-
import {
|
|
62
|
+
import { createKokoroTTS } from '@omote/core';
|
|
63
63
|
|
|
64
64
|
const avatar = new OmoteAvatar({ target: rootMesh, scene });
|
|
65
65
|
await avatar.connectVoice({
|
|
66
|
-
|
|
66
|
+
mode: 'local',
|
|
67
|
+
tts: createKokoroTTS({ defaultVoice: 'af_heart' }),
|
|
67
68
|
interruptionEnabled: true,
|
|
68
69
|
onTranscript: async (text) => {
|
|
69
70
|
const res = await fetch('/api/chat', { body: text });
|
|
@@ -76,6 +77,34 @@ await avatar.connectSpeaker(ttsBackend, { lam: createA2E() });
|
|
|
76
77
|
await avatar.speak("Hello!");
|
|
77
78
|
```
|
|
78
79
|
|
|
80
|
+
### Listener (Speech Recognition)
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { OmoteAvatar } from '@omote/babylon';
|
|
84
|
+
|
|
85
|
+
const avatar = new OmoteAvatar({ target: rootMesh, scene });
|
|
86
|
+
|
|
87
|
+
// Connect listener (mic + VAD + ASR)
|
|
88
|
+
await avatar.connectListener();
|
|
89
|
+
avatar.onTranscript((result) => {
|
|
90
|
+
console.log('Transcript:', result.text);
|
|
91
|
+
});
|
|
92
|
+
await avatar.startListening();
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Auto Update
|
|
96
|
+
|
|
97
|
+
Use `autoUpdate: true` to skip manual `update()` calls:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
const avatar = new OmoteAvatar({
|
|
101
|
+
target: rootMesh,
|
|
102
|
+
scene,
|
|
103
|
+
autoUpdate: true,
|
|
104
|
+
});
|
|
105
|
+
avatar.setCamera(scene.activeCamera);
|
|
106
|
+
```
|
|
107
|
+
|
|
79
108
|
## License
|
|
80
109
|
|
|
81
110
|
MIT
|