@spatialwalk/avatarkit 1.0.0-beta.30 → 1.0.0-beta.32

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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.0-beta.32] - 2025-12-16
9
+
10
+ ### 🔄 Breaking Changes
11
+ - **Host Mode Interface** - Updated `yieldFramesData` method to accept binary data array instead of single binary data. The method now processes multiple protobuf-encoded Message objects in a single call.
12
+
13
+ ## [1.0.0-beta.31] - 2025-12-16
14
+
15
+ ### 🐛 Bugfix
16
+ - **Environment CORS Issue** - Fixed CORS issues when requesting configuration and character data APIs. SDK now provides default configuration fallback when config requests fail, ensuring smooth operation across different environments.
17
+
8
18
  ## [1.0.0-beta.30] - 2025-12-15
9
19
 
10
20
  ### 🐛 Bugfix
package/README.md CHANGED
@@ -87,7 +87,7 @@ const avatarView = new AvatarView(avatar, container)
87
87
  // 4. Host Mode Workflow:
88
88
  // Send audio data first to get conversationId, then use it to send animation data
89
89
  const conversationId = avatarView.avatarController.yieldAudioData(audioData, false)
90
- avatarView.avatarController.yieldFramesData(animationData, conversationId)
90
+ avatarView.avatarController.yieldFramesData(animationDataArray, conversationId) // animationDataArray: (Uint8Array | ArrayBuffer)[]
91
91
  ```
92
92
 
93
93
  ### Complete Examples
@@ -177,7 +177,7 @@ External data source (audio + animation)
177
177
 
178
178
  AvatarController.yieldAudioData(audioChunk) // Returns conversationId
179
179
 
180
- AvatarController.yieldFramesData(keyframes, conversationId)
180
+ AvatarController.yieldFramesData(keyframesDataArray, conversationId) // keyframesDataArray: (Uint8Array | ArrayBuffer)[] - each element is a protobuf encoded Message
181
181
 
182
182
  AvatarController → AnimationPlayer (synchronized playback)
183
183
 
@@ -272,11 +272,11 @@ constructor(avatar: Avatar, container: HTMLElement)
272
272
  ```
273
273
 
274
274
  **Parameters:**
275
- - `avatar`: Avatar 实例
276
- - `container`: Canvas 容器元素(必选)
277
- - Canvas 自动使用容器的完整尺寸(宽度和高度)
278
- - Canvas 宽高比适应容器尺寸 - 设置容器尺寸以控制宽高比
279
- - Canvas 会自动添加到容器中
275
+ - `avatar`: Avatar instance
276
+ - `container`: Canvas container element (required)
277
+ - Canvas automatically uses the full size of the container (width and height)
278
+ - Canvas aspect ratio adapts to container size - set container size to control aspect ratio
279
+ - Canvas will be automatically added to the container
280
280
  - SDK automatically handles resize events via ResizeObserver
281
281
 
282
282
  **Playback Mode:**
@@ -348,8 +348,8 @@ const conversationId = avatarView.avatarController.yieldAudioData(
348
348
 
349
349
  // Stream animation keyframes (requires conversationId from audio data)
350
350
  avatarView.avatarController.yieldFramesData(
351
- keyframes: any[], // Animation keyframes (obtained from your service)
352
- conversationId: string // Conversation ID (required)
351
+ keyframesDataArray: (Uint8Array | ArrayBuffer)[], // Animation keyframes binary data array (each element is a protobuf encoded Message)
352
+ conversationId: string // Conversation ID (required)
353
353
  )
354
354
  ```
355
355
 
@@ -472,18 +472,18 @@ enum ConnectionState {
472
472
 
473
473
  ```typescript
474
474
  enum ConversationState {
475
- idle = 'idle', // 呼吸态
476
- playing = 'playing' // 播放态
475
+ idle = 'idle', // Idle state (breathing animation)
476
+ playing = 'playing' // Playing state (active conversation)
477
477
  }
478
478
  ```
479
479
 
480
- **状态说明:**
481
- - `idle`: 数字人处于呼吸态,等待对话开始
482
- - `playing`: 数字人正在播放对话内容(包括过渡动画期间)
480
+ **State Description:**
481
+ - `idle`: Avatar is in idle state (breathing animation), waiting for conversation to start
482
+ - `playing`: Avatar is playing conversation content (including during transition animations)
483
483
 
484
- **注意:** 过渡动画期间会提前通知目标状态:
485
- - `idle` 过渡到 `playing` 时,立即通知 `playing` 状态
486
- - `playing` 过渡到 `idle` 时,立即通知 `idle` 状态
484
+ **Note:** During transition animations, the target state is notified immediately:
485
+ - When transitioning from `idle` to `playing`, the `playing` state is notified immediately
486
+ - When transitioning from `playing` to `idle`, the `idle` state is notified immediately
487
487
 
488
488
  ## 🎨 Rendering System
489
489
 
@@ -552,7 +552,7 @@ const avatarView = new AvatarView(avatar, container)
552
552
 
553
553
  // Use
554
554
  const conversationId = avatarView.avatarController.yieldAudioData(audioChunk, false)
555
- avatarView.avatarController.yieldFramesData(keyframes, conversationId)
555
+ avatarView.avatarController.yieldFramesData(keyframesDataArray, conversationId) // keyframesDataArray: (Uint8Array | ArrayBuffer)[]
556
556
 
557
557
  // Cleanup
558
558
  avatarView.avatarController.clear() // Clear all data and resources
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-FJY_63Bh.js";
4
+ import { A as APP_CONFIG, e as errorToMessage, l as logEvent, a as logger } from "./index-CFQb9r1N.js";
5
5
  class StreamingAudioPlayer {
6
6
  constructor(options) {
7
7
  __publicField(this, "audioContext", null);
File without changes
@@ -39,7 +39,7 @@ export declare class AvatarController {
39
39
  send(audioData: ArrayBuffer, end?: boolean): string | null;
40
40
  close(): void;
41
41
  yieldAudioData(data: Uint8Array, isLast?: boolean): string | null;
42
- yieldFramesData(keyframes: Flame[], conversationId: string): void;
42
+ yieldFramesData(keyframesDataArray: (Uint8Array | ArrayBuffer)[], conversationId: string): void;
43
43
  pause(): void;
44
44
  resume(): Promise<void>;
45
45
  interrupt(): void;