@spatialwalk/avatarkit 1.0.0-beta.3 โ†’ 1.0.0-beta.31

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +441 -0
  2. package/README.md +328 -138
  3. package/dist/StreamingAudioPlayer-B07iPxK4.js +398 -0
  4. package/dist/animation/AnimationWebSocketClient.d.ts +6 -24
  5. package/dist/animation/utils/eventEmitter.d.ts +0 -4
  6. package/dist/animation/utils/flameConverter.d.ts +3 -11
  7. package/dist/audio/AnimationPlayer.d.ts +5 -29
  8. package/dist/audio/StreamingAudioPlayer.d.ts +8 -66
  9. package/dist/avatar_core_wasm-i0Ocpx6q.js +2693 -0
  10. package/dist/avatar_core_wasm.wasm +0 -0
  11. package/dist/config/app-config.d.ts +4 -13
  12. package/dist/config/constants.d.ts +18 -11
  13. package/dist/config/sdk-config-loader.d.ts +2 -9
  14. package/dist/core/Avatar.d.ts +0 -15
  15. package/dist/core/AvatarController.d.ts +49 -109
  16. package/dist/core/AvatarDownloader.d.ts +0 -95
  17. package/dist/core/AvatarManager.d.ts +7 -18
  18. package/dist/core/AvatarSDK.d.ts +21 -0
  19. package/dist/core/AvatarView.d.ts +25 -119
  20. package/dist/core/NetworkLayer.d.ts +1 -0
  21. package/dist/generated/driveningress/v1/driveningress.d.ts +1 -12
  22. package/dist/generated/driveningress/v2/driveningress.d.ts +0 -3
  23. package/dist/generated/google/protobuf/struct.d.ts +5 -39
  24. package/dist/generated/google/protobuf/timestamp.d.ts +1 -103
  25. package/dist/index-CCBBCJi2.js +7915 -0
  26. package/dist/index.d.ts +1 -6
  27. package/dist/index.js +17 -17
  28. package/dist/renderer/RenderSystem.d.ts +1 -77
  29. package/dist/renderer/covariance.d.ts +0 -12
  30. package/dist/renderer/renderer.d.ts +0 -1
  31. package/dist/renderer/sortSplats.d.ts +0 -11
  32. package/dist/renderer/webgl/reorderData.d.ts +0 -13
  33. package/dist/renderer/webgl/webglRenderer.d.ts +3 -40
  34. package/dist/renderer/webgpu/webgpuRenderer.d.ts +3 -28
  35. package/dist/types/character-settings.d.ts +0 -5
  36. package/dist/types/character.d.ts +3 -21
  37. package/dist/types/index.d.ts +38 -18
  38. package/dist/utils/animation-interpolation.d.ts +3 -13
  39. package/dist/utils/client-id.d.ts +1 -0
  40. package/dist/utils/cls-tracker.d.ts +11 -0
  41. package/dist/utils/conversationId.d.ts +1 -0
  42. package/dist/utils/error-utils.d.ts +1 -25
  43. package/dist/utils/heartbeat-manager.d.ts +18 -0
  44. package/dist/utils/id-manager.d.ts +37 -0
  45. package/dist/utils/logger.d.ts +5 -11
  46. package/dist/utils/usage-tracker.d.ts +5 -0
  47. package/dist/vanilla/vite.config.d.ts +2 -0
  48. package/dist/wasm/avatarCoreAdapter.d.ts +11 -97
  49. package/dist/wasm/avatarCoreMemory.d.ts +5 -54
  50. package/package.json +10 -4
  51. package/dist/StreamingAudioPlayer-BeLlDiwE.js +0 -288
  52. package/dist/StreamingAudioPlayer-BeLlDiwE.js.map +0 -1
  53. package/dist/animation/AnimationWebSocketClient.d.ts.map +0 -1
  54. package/dist/animation/utils/eventEmitter.d.ts.map +0 -1
  55. package/dist/animation/utils/flameConverter.d.ts.map +0 -1
  56. package/dist/audio/AnimationPlayer.d.ts.map +0 -1
  57. package/dist/audio/StreamingAudioPlayer.d.ts.map +0 -1
  58. package/dist/avatar_core_wasm-DmkU6dYn.js +0 -1666
  59. package/dist/avatar_core_wasm-DmkU6dYn.js.map +0 -1
  60. package/dist/config/app-config.d.ts.map +0 -1
  61. package/dist/config/constants.d.ts.map +0 -1
  62. package/dist/config/sdk-config-loader.d.ts.map +0 -1
  63. package/dist/core/Avatar.d.ts.map +0 -1
  64. package/dist/core/AvatarController.d.ts.map +0 -1
  65. package/dist/core/AvatarDownloader.d.ts.map +0 -1
  66. package/dist/core/AvatarKit.d.ts +0 -60
  67. package/dist/core/AvatarKit.d.ts.map +0 -1
  68. package/dist/core/AvatarManager.d.ts.map +0 -1
  69. package/dist/core/AvatarView.d.ts.map +0 -1
  70. package/dist/generated/driveningress/v1/driveningress.d.ts.map +0 -1
  71. package/dist/generated/driveningress/v2/driveningress.d.ts.map +0 -1
  72. package/dist/generated/google/protobuf/struct.d.ts.map +0 -1
  73. package/dist/generated/google/protobuf/timestamp.d.ts.map +0 -1
  74. package/dist/index-NmYXWJnL.js +0 -9712
  75. package/dist/index-NmYXWJnL.js.map +0 -1
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/index.js.map +0 -1
  78. package/dist/renderer/RenderSystem.d.ts.map +0 -1
  79. package/dist/renderer/covariance.d.ts.map +0 -1
  80. package/dist/renderer/renderer.d.ts.map +0 -1
  81. package/dist/renderer/sortSplats.d.ts.map +0 -1
  82. package/dist/renderer/webgl/reorderData.d.ts.map +0 -1
  83. package/dist/renderer/webgl/webglRenderer.d.ts.map +0 -1
  84. package/dist/renderer/webgpu/webgpuRenderer.d.ts.map +0 -1
  85. package/dist/types/character-settings.d.ts.map +0 -1
  86. package/dist/types/character.d.ts.map +0 -1
  87. package/dist/types/index.d.ts.map +0 -1
  88. package/dist/utils/animation-interpolation.d.ts.map +0 -1
  89. package/dist/utils/error-utils.d.ts.map +0 -1
  90. package/dist/utils/logger.d.ts.map +0 -1
  91. package/dist/utils/posthog-tracker.d.ts +0 -82
  92. package/dist/utils/posthog-tracker.d.ts.map +0 -1
  93. package/dist/utils/reqId.d.ts +0 -20
  94. package/dist/utils/reqId.d.ts.map +0 -1
  95. package/dist/wasm/avatarCoreAdapter.d.ts.map +0 -1
  96. package/dist/wasm/avatarCoreMemory.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,441 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0-beta.31] - 2025-12-16
9
+
10
+ ### ๐Ÿ› Bugfix
11
+ - **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.
12
+
13
+ ## [1.0.0-beta.30] - 2025-12-15
14
+
15
+ ### ๐Ÿ› Bugfix
16
+ - **Template Resources Duplicate Download** - Fixed issue where template resources were being re-downloaded for each new character load. Template resources are now only loaded once during SDK initialization and reused for all characters.
17
+
18
+ ## [1.0.0-beta.29] - 2025-12-15
19
+
20
+ ### ๐Ÿ”„ Breaking Changes
21
+ - **Environment Enum** - Removed `Environment.test`. Only `Environment.cn` and `Environment.intl` are now supported. Environment configuration must be explicitly provided.
22
+ - **Log Level Default** - Default log level changed from `LogLevel.all` to `LogLevel.off`. Set `logLevel: LogLevel.all` in configuration to enable all logs.
23
+
24
+ ### โœจ New Features
25
+ - **Avatar Caching** - Added avatar caching methods in `AvatarManager`:
26
+ - `retrieve(id: string): Avatar | undefined` - Get cached avatar by ID
27
+ - `clear(id: string): void` - Clear cached avatar for specific ID
28
+ - `clearAll(): void` - Clear all cached avatars
29
+ - `clearCache()` is now deprecated, use `clearAll()` instead
30
+ - **Background Image Support** - Added background image control in `AvatarView`:
31
+ - `isOpaque: boolean` - Getter/setter to control canvas background transparency
32
+ - `setBackgroundImage(image: HTMLImageElement | string | null): void` - Set or remove background image
33
+
34
+ ### ๐Ÿ”ง Improvements
35
+ - **Avatar Version Checking** - Avatar cache now automatically checks version and reloads if cached avatar version differs from latest metadata
36
+ - **Concurrent Loading** - Multiple concurrent `load()` calls for the same avatar ID now reuse the same loading promise
37
+
38
+ ## [1.0.0-beta.28] - 2025-12-08
39
+
40
+ ### ๐Ÿ”„ Breaking Changes
41
+ - **Class Renamed** - `AvatarKit` class has been renamed to `AvatarSDK` for better consistency
42
+ - Update all imports: `import { AvatarKit } from '@spatialwalk/avatarkit'` โ†’ `import { AvatarSDK } from '@spatialwalk/avatarkit'`
43
+ - Update all API calls: `AvatarKit.initialize()` โ†’ `AvatarSDK.initialize()`
44
+ - All static methods and properties remain the same, only the class name has changed
45
+
46
+ ### ๐Ÿ”ง Improvements
47
+ - **Rendering Optimizations** - Added fragment shader discard optimization to improve performance and edge quality
48
+ - **Shader Alignment** - Removed view matrix transpose to align with Android SDK implementation
49
+ - **Resource Cleanup** - Removed unused `frameMono` and `audioMono` resources from SDK and tests
50
+
51
+ ## [1.0.0-beta.27] - 2025-12-04
52
+
53
+ ### ๐Ÿ› Bugfix
54
+
55
+ ## [1.0.0-beta.26] - 2025-12-03
56
+
57
+ ### โœจ New Features
58
+ - **Log Level Configuration** - Added `logLevel` configuration option to control SDK logging verbosity
59
+ - `LogLevel.off` - Disable all logs
60
+ - `LogLevel.error` - Only error logs
61
+ - `LogLevel.warning` - Warning and error logs
62
+ - `LogLevel.all` - All logs (default)
63
+ - **Standardized CLS Logging Events** - All CLS logging events now use standardized field names for better querying
64
+ - Standard events: `sdk_initialized`, `send_audio_failed`, `message_error`, `heartbeat_failed`, `service_restarted`, `session_token_invalid`, `session_token_expired`, `yield_animation_failed`, `fetch_avatar_metadata_failed`, `download_avatar_assets_failed`
65
+ - Standard fields: `req_id`, `con_id`, `avatar_id`, `description`
66
+ - **End-to-End Latency Tracking** - Added `driving_latency` event to track latency metrics for both SDK and Host modes
67
+ - Tracks: `start`, `tap2`, `tap4`, `end`, `first_frame` timestamps
68
+ - Automatically reported at key moments during audio/animation processing
69
+
70
+ ### ๐Ÿ”ง Improvements
71
+ - **CLS Configuration Alignment** - Updated CLS endpoints and Topic IDs to match iOS SDK configuration
72
+ - **Default API Endpoints** - Fixed default API endpoint for `intl` environment to `api.intl.spatialwalk.cloud`
73
+ - **Error Code Enum** - Added new error codes: `appIDUnrecognized`, `sessionTokenInvalid`, `sessionTokenExpired`, `failedToFetchAvatarMetadata`, `failedToDownloadAvatarAssets`
74
+
75
+ ### ๐Ÿ—‘๏ธ Removed
76
+ - **Redundant Log Events** - Removed unnecessary log events: `playback_paused`, `playback_resumed`, `reconnecting`, `connect_success`, `server_error`, `decode_failed`
77
+
78
+ ## [1.0.0-beta.25] - 2025-12-03
79
+
80
+ ### ๐Ÿ”ง Improvements
81
+ - **Removed Audio Buffer Limit** - Removed the 100 chunk limit on pending audio buffers to allow unlimited audio data buffering
82
+
83
+ ## [1.0.0-beta.24] - 2025-11-26
84
+
85
+ ### ๐Ÿ”ง API Changes
86
+ - **Backend Endpoints Updated** - Backend API endpoints have been updated for all environments
87
+
88
+ ## [1.0.0-beta.23] - 2025-11-26
89
+
90
+ ### ๐Ÿ”ง API Changes
91
+ - **Breaking Change** - `playback()` method is no longer supported and has been removed from public API
92
+
93
+ ## [1.0.0-beta.22] - 2025-11-26
94
+
95
+ ### ๐Ÿ”ง API Changes
96
+ - **State Callback Renamed** - `onAvatarState` has been renamed to `onConversationState` for better clarity
97
+ - The callback now uses `ConversationState` enum with states: `idle` and `playing`
98
+ - **Environment Enum Updated** - `Environment.us` has been renamed to `Environment.intl` for better internationalization support
99
+ - All references to `Environment.us` should be updated to `Environment.intl`
100
+ - Remote config endpoints now use `intl` instead of `us`
101
+
102
+ ### โœจ New Features
103
+ - **Volume Control** - Added volume control API for audio playback
104
+ - `setVolume(volume: number)` - Set audio volume (0.0 to 1.0)
105
+ - `getVolume(): number` - Get current audio volume
106
+ - Volume control only affects the avatar's audio player, not system volume
107
+ - Volume changes take effect immediately, including for currently playing audio
108
+
109
+ ## [1.0.0-beta.21] - 2025-11-25
110
+
111
+ ### โœจ New Features
112
+ - **SDK Mode Connection Timeout Fallback** - Enhanced fallback mechanism for SDK mode:
113
+ - If WebSocket connection fails to establish within 15 seconds, the SDK automatically enters fallback mode
114
+ - In fallback mode, audio data can still be sent and will play normally, even though no animation data will be received
115
+ - Connection failures also trigger this fallback mechanism
116
+ - `ConnectionState.connecting` and `ConnectionState.failed` events are emitted to notify external applications
117
+ - Concurrent connection attempts are prevented to avoid race conditions
118
+
119
+ ### ๐Ÿ”ง Improvements
120
+ - Improved connection state management: `isConnected` now accurately reflects actual connection status (false in fallback mode)
121
+ - Added `canSend()` method in `NetworkLayer` to check if audio can be sent (including fallback mode)
122
+ - Better separation of concerns: connection state checks are now handled by `NetworkLayer`, while playback logic remains in `AvatarController`
123
+
124
+ ## [1.0.0-beta.20] - 2025-11-25
125
+
126
+ ### ๐Ÿ”ง Improvements
127
+ - Removed 1-second audio buffer requirement for auto-starting playback in Host mode
128
+
129
+ ## [1.0.0-beta.19] - 2025-11-25
130
+
131
+ ### ๐Ÿ“š Documentation
132
+ - **Fixed misleading documentation** - Corrected Host mode API documentation to accurately reflect that `yieldAudioData()` can be called directly to start a new session without requiring `playback()` first
133
+ - Removed misleading "after playback() is called" comments
134
+ - Clarified two ways to start a session: using `playback()` for existing data, or `yieldAudioData()` directly for streaming
135
+ - Updated all examples and workflow descriptions to reflect correct API usage
136
+
137
+ ## [1.0.0-beta.18] - 2025-11-25
138
+
139
+ ### ๐Ÿ”ง API Changes
140
+ - **Renamed `reqId` to `conversationId`** - Updated terminology for better clarity
141
+ - All methods and parameters that used `reqId` now use `conversationId`
142
+ - `getCurrentReqId()` โ†’ `getCurrentConversationId()`
143
+ - `generateReqId()` โ†’ `generateConversationId()`
144
+ - Updated all event logs and documentation to use `conversationId`
145
+ - Note: Protobuf protocol still uses `reqId` field name internally, but SDK API uses `conversationId`
146
+
147
+ ### ๐Ÿ“š Documentation
148
+ - Enhanced Host mode documentation to clearly emphasize the workflow: send audio data first to get conversationId, then use that conversationId to send animation data
149
+ - Updated Host Mode Example and Host Mode Flow sections with clearer step-by-step instructions
150
+
151
+ ## [1.0.0-beta.17] - 2025-11-24
152
+
153
+ ### โœจ New Features
154
+ - **Audio-Only Fallback Mechanism** - SDK now includes automatic fallback to audio-only playback when animation data is unavailable
155
+ - SDK mode: Automatically enters audio-only mode when server returns an error
156
+ - Host mode: Automatically enters audio-only mode when empty animation data is provided
157
+ - Once in audio-only mode, subsequent animation data for that session is ignored
158
+ - Fallback mode is interruptible, just like normal playback mode
159
+
160
+ ### ๐Ÿ”ง API Changes
161
+ - **Playback Mode Configuration** - Moved playback mode configuration from `AvatarView` constructor to `AvatarSDK.initialize()`
162
+ - Playback mode is now determined by `drivingServiceMode` in `AvatarSDK.initialize()` configuration
163
+ - `AvatarView` constructor now only requires `avatar` and `container` parameters
164
+ - Removed `AvatarViewOptions` interface
165
+ - `container` parameter is now required (no longer optional)
166
+ - **Method Renames** - Renamed methods in `AvatarController` for Host mode to better reflect their purpose
167
+ - `play()` โ†’ `playback()`: Renamed to better reflect that the method is used for playback of existing data (replay mode)
168
+ - Old API: `avatarController.play(initialAudioChunks, initialKeyframes)`
169
+ - New API: `avatarController.playback(initialAudioChunks, initialKeyframes)`
170
+ - `sendAudioChunk()` โ†’ `yieldAudioData()`: Renamed to better reflect that the method yields/streams audio data
171
+ - Old API: `avatarController.sendAudioChunk(data, isLast)`
172
+ - New API: `avatarController.yieldAudioData(data, isLast)`
173
+ - `sendKeyframes()` โ†’ `yieldFramesData()`: Renamed to better reflect that the method yields/streams animation keyframes
174
+ - Old API: `avatarController.sendKeyframes(keyframes, reqId)`
175
+ - New API: `avatarController.yieldFramesData(keyframes, conversationId)`
176
+
177
+ ### ๐Ÿ”ง Improvements
178
+ - Extended transition animation duration from 200ms to 400ms for smoother end-of-playback transitions
179
+
180
+ ### ๐Ÿ“š Documentation
181
+ - Updated README.md to use "SDK mode" and "Host mode" terminology instead of "Network mode" and "External data mode"
182
+ - Added fallback mechanism documentation
183
+ - Updated API reference to reflect new constructor signature
184
+
185
+ ## [1.0.0-beta.16] - 2025-11-21
186
+
187
+ ### โœจ New Features
188
+ - **Multi-AvatarView Support** - SDK now supports multiple `AvatarView` instances simultaneously
189
+ - Each `AvatarView` instance can manage its own character independently
190
+ - Multiple characters can be displayed and controlled at the same time
191
+ - Each instance maintains its own rendering context, playback state, and network connection
192
+ - Removed the previous limitation of "only one AvatarView instance at a time"
193
+
194
+ ### ๐Ÿ“š Documentation
195
+ - Updated README.md to reflect multi-character support capabilities
196
+ - Added multi-character usage examples
197
+ - Removed outdated limitation notes about single AvatarView instance
198
+
199
+ ---
200
+
201
+ ## [1.0.0-beta.15] - 2025-11-20
202
+
203
+ ### โœจ New Features
204
+ - Added authentication support for API requests
205
+ - `appId` is now automatically included in HTTP headers (`X-App-Id`) and WebSocket URL query parameters
206
+ - `sessionToken` is now automatically included in HTTP headers (`Authorization: Bearer {token}`) and WebSocket URL query parameters
207
+ - All network requests (character loading, resource downloads, WebSocket connections) now include authentication credentials
208
+
209
+ ### ๐Ÿ”ง Improvements
210
+ - Fixed canvas resize handling for different aspect ratios
211
+ - Projection matrix is now correctly updated when canvas aspect ratio changes
212
+ - Rendering system properly handles portrait (9:16) and landscape (16:9) aspect ratios
213
+ - Canvas automatically adapts to container size changes via ResizeObserver
214
+
215
+ ### ๐Ÿ› Bug Fixes
216
+ - Fixed `RenderSystem.handleResize()` to update projection matrix when canvas size changes
217
+ - Previously only updated aspect ratio, now also updates projection matrix for correct rendering
218
+
219
+ ---
220
+
221
+ ## [1.0.0-beta.14] - 2025-11-18
222
+
223
+ ### โœจ New Features
224
+ - Added pause and resume functionality for avatar playback
225
+ - New `pause()` method to pause audio and animation playback
226
+ - New `resume()` method to resume playback from paused state
227
+ - Added `paused` state to `AvatarState` enum
228
+ - State changes are communicated via `onAvatarState` callback
229
+ - Works in both network mode and external data mode
230
+
231
+ ### ๐Ÿ”ง Improvements
232
+ - Canvas now uses container's full dimensions instead of fixed 1:1 aspect ratio
233
+ - Canvas automatically adapts to container size (width and height)
234
+ - External developers can control canvas aspect ratio by setting container dimensions
235
+ - Rendering system correctly handles any aspect ratio without distortion
236
+
237
+ ---
238
+
239
+ ## [1.0.0-beta.13] - 2025-11-17
240
+
241
+ ### ๐Ÿ”’ API Improvements
242
+ - Reduced console noise by setting default log level to Warning
243
+ - Logger now only outputs warnings and errors by default
244
+ - Set `VITE_DEBUG_LOG=true` to enable all logs
245
+ - Simplified logger configuration using `setGlobalLogLevel(LogLevel.Warning)`
246
+
247
+ ### ๐Ÿ› Bug Fixes
248
+ - Fixed SDK config loader warning in non-debug mode
249
+ - Config loading failures are now silently handled in production
250
+ - Warnings only shown when `VITE_DEBUG_LOG=true`
251
+
252
+ ---
253
+
254
+ ## [1.0.0-beta.12] - 2025-11-17
255
+
256
+ ### ๐Ÿ”’ API Improvements
257
+ - Marked performance monitoring APIs as internal
258
+ - `RenderPerformanceStats` interface and `getPerformanceStats()` method are now marked with `@internal` tag
259
+ - These APIs are not exposed in the public TypeScript definitions
260
+ - Reverted performance monitoring implementation to simpler version (only `renderTime` and `sortTime`)
261
+
262
+ ---
263
+
264
+ ## [1.0.0-beta.11] - 2025-11-17
265
+
266
+ ### ๐Ÿ“š Documentation
267
+ - Updated demo repository link in README.md
268
+ - Changed example project link from `Avatarkit-web-demo` to `AvatarSDK-Web-Demo` to match the new repository name
269
+
270
+ ---
271
+
272
+ ## [1.0.0-beta.10] - 2025-11-16
273
+
274
+ ### ๐Ÿ”’ API Improvements
275
+ - Cleaned up public API to hide internal implementation details
276
+ - Marked internal methods with `@internal` JSDoc tag to exclude them from TypeScript declarations
277
+ - Removed unused environment configuration options (`realtimeApiBaseUrl`, `realtimeWsUrl`)
278
+ - Added `appId` getter to `AvatarSDK` for accessing initialized app ID
279
+ - Internal methods like `getEnvironmentConfig`, `logEvent`, `getCanvas`, `getCameraConfig`, `updateCameraConfig` are now properly hidden from public API
280
+
281
+ ### ๐Ÿ› Bug Fixes
282
+ - Fixed memory leaks when disposing AvatarView instances
283
+ - Improved resource cleanup to prevent memory leaks when switching or disposing avatar instances
284
+ - Properly clears all callbacks, event listeners, and large data buffers on disposal
285
+
286
+ ---
287
+ ## [1.0.0-beta.9] - 2025-11-15
288
+
289
+ ### ๐Ÿ› Bug Fixes
290
+ - Fixed memory leaks when disposing AvatarView instances
291
+ - Improved resource cleanup to prevent memory leaks when switching or disposing avatar instances
292
+ - Properly clears all callbacks, event listeners, and large data buffers on disposal
293
+
294
+ ---
295
+
296
+ ## [1.0.0-beta.8] - 2025-11-14
297
+
298
+ ### ๐Ÿ› Bug Fixes
299
+ - Fixed audio-animation synchronization issue after normal playback completion
300
+ - Playback state is now properly cleaned up when audio finishes normally, preventing synchronization issues in subsequent conversations
301
+
302
+ ---
303
+
304
+ ## [1.0.0-beta.7] - 2025-11-14
305
+
306
+ ### ๐Ÿ”„ Refactoring
307
+ - Improved rendering state management for better stability and maintainability
308
+
309
+ ### ๐Ÿ› Bug Fixes
310
+ - Fixed interrupt not generating transition animation when interrupting during playback
311
+ - Fixed transition animation being regenerated and reset in external data mode when sending keyframes after playback starts
312
+
313
+ ---
314
+
315
+ ## [1.0.0-beta.6] - 2025-11-14
316
+
317
+ ### ๐Ÿ› Bug Fixes
318
+ - Fixed transition animation being regenerated and reset in external data mode when sending keyframes after playback starts, causing the transition to play twice
319
+
320
+ ---
321
+
322
+ ## [1.0.0-beta.5] - 2025-11-14
323
+
324
+ ### ๐Ÿ› Bug Fixes
325
+ - Fixed missing `DrivingServiceMode` enum export in published package
326
+
327
+ ---
328
+
329
+ ## [1.0.0-beta.4] - 2025-11-14
330
+
331
+ ### ๐Ÿ”„ Updates
332
+ - Updated WASM module (avatar_core_wasm.wasm)
333
+
334
+ ---
335
+
336
+ ## [1.0.0-beta.3] - 2025-11-13
337
+
338
+ ### ๐ŸŽ‰ Major Changes
339
+
340
+ #### Architecture Refactoring - Three-Layer Architecture
341
+ - **Rendering Layer (AvatarView)**: Pure rendering responsibility, receives rendering instructions from the playback layer
342
+ - **Playback Layer (AvatarController)**: Unified data controller responsible for audio playback and animation rendering synchronization
343
+ - **Network Layer (NetworkLayer)**: Optional network communication layer, automatically composed only in network mode
344
+
345
+ #### Dual Playback Mode Support
346
+ - **Network Mode**:
347
+ - Send audio data to server via WebSocket
348
+ - Automatically receive and play animation data returned from server
349
+ - Use `controller.start()` and `controller.send()` methods
350
+
351
+ - **External Data Mode**:
352
+ - External components fully control audio and animation data acquisition
353
+ - SDK only responsible for synchronized playback of externally provided data
354
+ - Use `controller.playback()`, `controller.yieldAudioData()` and `controller.yieldFramesData()` methods
355
+
356
+ ### โœจ New Features
357
+
358
+ - **Transition Animation Optimization**:
359
+ - Transition animation duration adjusted to 200ms
360
+ - Improved audio-animation synchronization logic, ensuring audio and animation start playing together after transition animation ends
361
+ - Optimized transition frame generation and alignment logic
362
+
363
+ - **Camera Configuration Enhancement**:
364
+ - Default transparent background, background rendering functionality removed
365
+ - Camera configuration aligned with iOS (Reversed-Z projection, near=0.01, far=100)
366
+ - Support dynamic camera configuration loading from characterSettings and camera.json
367
+
368
+ - **Audio Sample Rate Configuration**:
369
+ - Updated default audio sample rate to 16kHz (previously 24kHz) to match backend requirements
370
+ - Audio format requirement: 16kHz mono PCM16
371
+
372
+ - **Telemetry Migration**:
373
+ - Migrated from PostHog to Tencent Cloud CLS (Cloud Log Service)
374
+ - Support environment-based dynamic configuration (cn/test/us)
375
+ - Support both Token and SecretId/SecretKey authentication methods
376
+ - Aligned with iOS SDK configuration
377
+
378
+ ### ๐Ÿ”ง API Changes
379
+
380
+ #### Breaking Changes
381
+
382
+ - **AvatarView Constructor**:
383
+ ```typescript
384
+ // Old API
385
+ new AvatarView(avatar, container)
386
+
387
+ // New API
388
+ new AvatarView(avatar, {
389
+ container: container,
390
+ playbackMode: DrivingServiceMode.sdk // or DrivingServiceMode.host
391
+ })
392
+ ```
393
+
394
+ - **AvatarController Methods**:
395
+ - Network Mode: `start()` / `close()` / `send()`
396
+ - External Data Mode: `play()` / `sendAudioChunk()` / `sendKeyframes()`
397
+ - Common Methods: `interrupt()` / `clear()` / `dispose()`
398
+
399
+ - **Removed Properties**:
400
+ - `realtimeStartTime` property removed (no longer needed)
401
+
402
+ ### ๐Ÿ› Bug Fixes
403
+
404
+ - Fixed audio-animation desynchronization during transition animation
405
+ - Fixed animation freezing issue in external data mode
406
+ - Fixed audio playback speed abnormality caused by sample rate mismatch
407
+ - Fixed camera configuration priority logic
408
+ - Fixed WebSocket connection state callback timing issues
409
+
410
+ ### ๐Ÿ“š Documentation
411
+
412
+ - Updated README.md with detailed explanation of three-layer architecture and two playback modes
413
+ - Added audio format requirements documentation (16kHz mono PCM16)
414
+ - Updated API reference documentation and code examples
415
+ - Added architecture diagrams and flowcharts
416
+
417
+ ### ๐Ÿงช Testing
418
+
419
+ - Updated unit tests to cover new architecture
420
+ - Added unit tests for external data mode
421
+ - Updated E2E tests to use new API
422
+ - All tests passing (69 unit tests + 24 E2E tests)
423
+
424
+ ### ๐Ÿ”„ Internal Changes
425
+
426
+ - Refactored `AvatarController` into unified playback layer
427
+ - Extracted `NetworkLayer` as independent component
428
+ - Optimized animation playback loop and audio-animation synchronization logic
429
+ - Updated WASM module (avatar_core_wasm.wasm)
430
+ - Improved error handling and logging
431
+
432
+ ### ๐Ÿ“ฆ Dependencies
433
+
434
+ - No new dependencies added
435
+ - Maintained existing dependency versions
436
+
437
+ ---
438
+
439
+ ## [1.0.0-beta.2] - Previous Version
440
+
441
+ (Previous version changelog entries...)