@spatialwalk/avatarkit 1.0.0-beta.96 → 1.0.0-beta.98

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,34 @@ 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.98]
9
+
10
+ ### 🐛 Bugfixes
11
+
12
+ - **Build artifact fix** — beta.97 npm package contained stale build artifacts. This release contains the correct build with all beta.97 changes.
13
+
14
+ ### ⚡ Breaking Changes
15
+
16
+ - **`setVolume()` / `getVolume()` replaced by `volume` property** — `controller.setVolume(0.5)` is now `controller.volume = 0.5`. Aligned with Android and iOS SDKs.
17
+
18
+ ## [1.0.0-beta.97]
19
+
20
+ ### ⚡ Breaking Changes
21
+
22
+ - **`transform` renamed to `avatarTransform`** — `avatarView.transform` is now `avatarView.avatarTransform`. Aligned naming across Web, Android, and iOS SDKs.
23
+
24
+ ### ✨ Features
25
+
26
+ - **Avatar transform from character settings** — Avatar automatically applies position and scale from character settings. User-set `avatarTransform` stacks on top of the base values.
27
+
28
+ ### 🐛 Bugfixes
29
+
30
+ - **Rendering quality improvement** — Improved color accuracy for avatar rendering.
31
+
32
+ ### 📝 Documentation
33
+
34
+ - **send() byte alignment** — Documented PCM S16LE byte alignment requirement for `send()`.
35
+
8
36
  ## [1.0.0-beta.96]
9
37
 
10
38
  ### 🐛 Bugfixes
@@ -175,7 +203,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
175
203
 
176
204
  ### 🔧 Improvements
177
205
  - **API Documentation** - All public API comments are now in English with JSDoc support for better IDE IntelliSense
178
- - **Type Safety** - Removed internal types from public API exports, using `KeyframeData` instead of `Flame`
206
+ - **Type Safety** - Removed internal types from public API exports
179
207
  - **Build Configuration** - JSDoc comments are now preserved in generated `.d.ts` files
180
208
 
181
209
  ### 📚 Documentation
@@ -264,7 +292,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
264
292
 
265
293
  ### 🔧 Improvements
266
294
  - **Transition API Enhancement** - Updated `generateTransitionFromIdle()` to support both start and end transitions
267
- - Added `transitionType` parameter: `'start'` for Idle -> Flame, `'end'` for Flame -> Idle
295
+ - Added `transitionType` parameter: `'start'` for idle-to-speaking, `'end'` for speaking-to-idle
268
296
  - Removed deprecated linear interpolation code and unused easing functions
269
297
 
270
298
  ## [1.0.0-beta.61] - 2026-01-14
@@ -290,7 +318,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
290
318
  ## [1.0.0-beta.58] - 2026-01-14
291
319
 
292
320
  ### ✨ New Features
293
- - **Pure Rendering Mode APIs** - Added `renderFlame()` and `generateTransitionFromIdle()` methods to `AvatarView` for external-controlled rendering without audio synchronization
321
+ - **Pure Rendering Mode APIs** - Added `renderFrame()` and `generateTransitionFromIdle()` methods to `AvatarView` for external-controlled rendering without audio synchronization
294
322
 
295
323
  ## [1.0.0-beta.57] - 2026-01-09
296
324
 
package/README.md CHANGED
@@ -282,7 +282,9 @@ button.addEventListener('click', async () => {
282
282
  })
283
283
 
284
284
  // 7. Send audio data (SDK mode, must be mono PCM16 format matching configured sample rate)
285
- // audioData: ArrayBuffer or Uint8Array containing PCM16 audio samples
285
+ // audioData: ArrayBuffer or Uint8Array containing PCM16 (S16LE) audio samples
286
+ // ⚠️ Byte length MUST be even (2 bytes per sample). Odd-length data will cause server-side
287
+ // validation error and WebSocket disconnect.
286
288
  // - PCM files: Can be directly read as ArrayBuffer
287
289
  // - WAV files: Extract PCM data from WAV format (may require resampling)
288
290
  // - MP3 files: Decode first (e.g., using AudioContext.decodeAudioData()), then convert to PCM16
@@ -590,10 +592,10 @@ avatarView.onFirstRendering = () => {
590
592
 
591
593
  // Get or set avatar transform (position and scale)
592
594
  // Get current transform
593
- const currentTransform = avatarView.transform // { x: number, y: number, scale: number }
595
+ const currentTransform = avatarView.avatarTransform // { x: number, y: number, scale: number }
594
596
 
595
597
  // Set transform
596
- avatarView.transform = { x, y, scale }
598
+ avatarView.avatarTransform = { x, y, scale }
597
599
  // - x: Horizontal offset in normalized coordinates (-1 to 1, where -1 = left edge, 0 = center, 1 = right edge)
598
600
  // - y: Vertical offset in normalized coordinates (-1 to 1, where -1 = bottom edge, 0 = center, 1 = top edge)
599
601
  // - scale: Scale factor (1.0 = original size, 2.0 = double size, 0.5 = half size)
@@ -714,8 +716,8 @@ const conversationId = avatarView.controller.getCurrentConversationId()
714
716
  // Returns: Current conversationId for the active audio session, or null if no active session
715
717
 
716
718
  // Volume control (affects only avatar audio player, not system volume)
717
- avatarView.controller.setVolume(0.5) // Set volume to 50% (0.0 to 1.0)
718
- const currentVolume = avatarView.controller.getVolume() // Get current volume (0.0 to 1.0)
719
+ avatarView.controller.volume = 0.5 // Set volume to 50% (0.0 to 1.0)
720
+ const currentVolume = avatarView.controller.volume // Get current volume (0.0 to 1.0)
719
721
 
720
722
  // Set event callbacks
721
723
  avatarView.controller.onConnectionState = (state: ConnectionState) => {} // SDK mode only
@@ -728,22 +730,22 @@ avatarView.controller.onError = (error: AvatarError) => {} // Includes error.cod
728
730
  ```typescript
729
731
  // Get or set avatar transform (position and scale in canvas)
730
732
  // Get current transform
731
- const currentTransform = avatarView.transform // { x: number, y: number, scale: number }
733
+ const currentTransform = avatarView.avatarTransform // { x: number, y: number, scale: number }
732
734
 
733
735
  // Set transform
734
- avatarView.transform = { x, y, scale }
736
+ avatarView.avatarTransform = { x, y, scale }
735
737
  // - x: Horizontal offset in normalized coordinates (-1 to 1, where -1 = left edge, 0 = center, 1 = right edge)
736
738
  // - y: Vertical offset in normalized coordinates (-1 to 1, where -1 = bottom edge, 0 = center, 1 = top edge)
737
739
  // - scale: Scale factor (1.0 = original size, 2.0 = double size, 0.5 = half size)
738
740
  // Example:
739
- avatarView.transform = { x: 0, y: 0, scale: 1.0 } // Center, original size
740
- avatarView.transform = { x: 0.5, y: 0, scale: 2.0 } // Right half, double size
741
+ avatarView.avatarTransform = { x: 0, y: 0, scale: 1.0 } // Center, original size
742
+ avatarView.avatarTransform = { x: 0.5, y: 0, scale: 2.0 } // Right half, double size
741
743
  ```
742
744
 
743
745
  **Important Notes:**
744
746
  - `start()` and `close()` are only available in SDK mode
745
747
  - `yieldAudioData()` and `yieldFramesData()` are only available in Host mode
746
- - `pause()`, `resume()`, `interrupt()`, `clear()`, `getCurrentConversationId()`, `setVolume()`, and `getVolume()` are available in both modes
748
+ - `pause()`, `resume()`, `interrupt()`, `clear()`, `getCurrentConversationId()`, and `volume` property are available in both modes
747
749
  - The playback mode is determined when creating `AvatarView` and cannot be changed
748
750
 
749
751
  ## 🔧 Configuration
@@ -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, l as logger, e as errorToMessage, a as logEvent } from "./index-DtnIjVSC.js";
4
+ import { A as APP_CONFIG, l as logger, e as errorToMessage, a as logEvent } from "./index-DfE9mnfH.js";
5
5
  class StreamingAudioPlayer {
6
6
  // Mark if AudioContext is being resumed, avoid concurrent resume requests
7
7
  constructor(options) {