@bevyra/avatar 0.0.0-stage → 0.1.1

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 CHANGED
@@ -1,3 +1,34 @@
1
- # Temporary Holding Version
1
+ # BeVyra browser avatar
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Render a downloaded BeVyra avatar on the user's device. Your app supplies speech audio and owns its ASR, LLM, and TTS.
4
+
5
+ [Developer guide](https://bevyra.ai/docs)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @bevyra/avatar
11
+ cp -R node_modules/@bevyra/avatar/dist public/bevyra-sdk
12
+ ```
13
+
14
+ Host the complete avatar `portable_v2` bundle under your own site, for example at `/avatars/noora/portable_v2/`. Serve the SDK's `dist` directory from the same origin at `/bevyra-sdk/`; the workers, WASM and ORT files are required.
15
+
16
+ ```ts
17
+ import { BevyraAvatar } from "@bevyra/avatar";
18
+
19
+ const avatar = await BevyraAvatar.mount({
20
+ avatarId: "noora",
21
+ canvas: document.querySelector("canvas")!,
22
+ bundleBaseUrl: "/avatars/noora/portable_v2/",
23
+ assetsBaseUrl: "/bevyra-sdk/",
24
+ });
25
+
26
+ await avatar.writeAudio(pcm16Samples, 24_000);
27
+ await avatar.endUtterance();
28
+ // On barge-in: avatar.interrupt();
29
+ // On teardown: avatar.close();
30
+ ```
31
+
32
+ Call `mount` from a user gesture so browser audio can start. Serve the page over HTTPS or localhost with `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp`; the threaded WASM path needs cross-origin isolation. Keep the source audio's true sample rate and its natural pauses. A licensed avatar bundle is supplied separately.
33
+
34
+ For playback events, use `onSpeechStart`, `onSpeechEnd`, and `speechClock`.