@spatialwalk/avatarkit 1.0.0-beta.2 → 1.0.0-beta.4

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 (45) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/README.md +429 -158
  3. package/dist/{StreamingAudioPlayer-CMEiGwxE.js → StreamingAudioPlayer-L87IFoao.js} +89 -58
  4. package/dist/StreamingAudioPlayer-L87IFoao.js.map +1 -0
  5. package/dist/animation/AnimationWebSocketClient.d.ts.map +1 -1
  6. package/dist/audio/AnimationPlayer.d.ts +4 -0
  7. package/dist/audio/AnimationPlayer.d.ts.map +1 -1
  8. package/dist/audio/StreamingAudioPlayer.d.ts +10 -0
  9. package/dist/audio/StreamingAudioPlayer.d.ts.map +1 -1
  10. package/dist/avatar_core_wasm-D4eEi7Eh.js +1666 -0
  11. package/dist/{avatar_core_wasm-DmkU6dYn.js.map → avatar_core_wasm-D4eEi7Eh.js.map} +1 -1
  12. package/dist/avatar_core_wasm.wasm +0 -0
  13. package/dist/config/app-config.d.ts +3 -7
  14. package/dist/config/app-config.d.ts.map +1 -1
  15. package/dist/config/constants.d.ts +19 -3
  16. package/dist/config/constants.d.ts.map +1 -1
  17. package/dist/core/AvatarController.d.ts +91 -64
  18. package/dist/core/AvatarController.d.ts.map +1 -1
  19. package/dist/core/AvatarDownloader.d.ts.map +1 -1
  20. package/dist/core/AvatarKit.d.ts +6 -0
  21. package/dist/core/AvatarKit.d.ts.map +1 -1
  22. package/dist/core/AvatarManager.d.ts.map +1 -1
  23. package/dist/core/AvatarView.d.ts +28 -30
  24. package/dist/core/AvatarView.d.ts.map +1 -1
  25. package/dist/core/NetworkLayer.d.ts +59 -0
  26. package/dist/core/NetworkLayer.d.ts.map +1 -0
  27. package/dist/index-BDxVrKwm.js +5942 -0
  28. package/dist/index-BDxVrKwm.js.map +1 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +12 -11
  31. package/dist/renderer/RenderSystem.d.ts +4 -2
  32. package/dist/renderer/RenderSystem.d.ts.map +1 -1
  33. package/dist/types/index.d.ts +18 -0
  34. package/dist/types/index.d.ts.map +1 -1
  35. package/dist/utils/cls-tracker.d.ts +17 -0
  36. package/dist/utils/cls-tracker.d.ts.map +1 -0
  37. package/dist/utils/logger.d.ts +1 -1
  38. package/dist/utils/logger.d.ts.map +1 -1
  39. package/package.json +8 -4
  40. package/dist/StreamingAudioPlayer-CMEiGwxE.js.map +0 -1
  41. package/dist/avatar_core_wasm-DmkU6dYn.js +0 -1666
  42. package/dist/index-CNhquYUE.js +0 -9712
  43. package/dist/index-CNhquYUE.js.map +0 -1
  44. package/dist/utils/posthog-tracker.d.ts +0 -82
  45. package/dist/utils/posthog-tracker.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,120 @@
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.4] - 2025-11-14
9
+
10
+ ### 🔄 Updates
11
+ - Updated WASM module (avatar_core_wasm.wasm)
12
+
13
+ ---
14
+
15
+ ## [1.0.0-beta.3] - 2025-11-13
16
+
17
+ ### 🎉 Major Changes
18
+
19
+ #### Architecture Refactoring - Three-Layer Architecture
20
+ - **Rendering Layer (AvatarView)**: Pure rendering responsibility, receives rendering instructions from the playback layer
21
+ - **Playback Layer (AvatarController)**: Unified data controller responsible for audio playback and animation rendering synchronization
22
+ - **Network Layer (NetworkLayer)**: Optional network communication layer, automatically composed only in network mode
23
+
24
+ #### Dual Playback Mode Support
25
+ - **Network Mode**:
26
+ - Send audio data to server via WebSocket
27
+ - Automatically receive and play animation data returned from server
28
+ - Use `controller.start()` and `controller.send()` methods
29
+
30
+ - **External Data Mode**:
31
+ - External components fully control audio and animation data acquisition
32
+ - SDK only responsible for synchronized playback of externally provided data
33
+ - Use `controller.play()`, `controller.sendAudioChunk()` and `controller.sendKeyframes()` methods
34
+
35
+ ### ✨ New Features
36
+
37
+ - **Transition Animation Optimization**:
38
+ - Transition animation duration adjusted to 200ms
39
+ - Improved audio-animation synchronization logic, ensuring audio and animation start playing together after transition animation ends
40
+ - Optimized transition frame generation and alignment logic
41
+
42
+ - **Camera Configuration Enhancement**:
43
+ - Default transparent background, background rendering functionality removed
44
+ - Camera configuration aligned with iOS (Reversed-Z projection, near=0.01, far=100)
45
+ - Support dynamic camera configuration loading from characterSettings and camera.json
46
+
47
+ - **Audio Sample Rate Configuration**:
48
+ - Updated default audio sample rate to 16kHz (previously 24kHz) to match backend requirements
49
+ - Audio format requirement: 16kHz mono PCM16
50
+
51
+ - **Telemetry Migration**:
52
+ - Migrated from PostHog to Tencent Cloud CLS (Cloud Log Service)
53
+ - Support environment-based dynamic configuration (cn/test/us)
54
+ - Support both Token and SecretId/SecretKey authentication methods
55
+ - Aligned with iOS SDK configuration
56
+
57
+ ### 🔧 API Changes
58
+
59
+ #### Breaking Changes
60
+
61
+ - **AvatarView Constructor**:
62
+ ```typescript
63
+ // Old API
64
+ new AvatarView(avatar, container)
65
+
66
+ // New API
67
+ new AvatarView(avatar, {
68
+ container: container,
69
+ playbackMode: AvatarPlaybackMode.network // or AvatarPlaybackMode.external
70
+ })
71
+ ```
72
+
73
+ - **AvatarController Methods**:
74
+ - Network Mode: `start()` / `close()` / `send()`
75
+ - External Data Mode: `play()` / `sendAudioChunk()` / `sendKeyframes()`
76
+ - Common Methods: `interrupt()` / `clear()` / `dispose()`
77
+
78
+ - **Removed Properties**:
79
+ - `realtimeStartTime` property removed (no longer needed)
80
+
81
+ ### 🐛 Bug Fixes
82
+
83
+ - Fixed audio-animation desynchronization during transition animation
84
+ - Fixed animation freezing issue in external data mode
85
+ - Fixed audio playback speed abnormality caused by sample rate mismatch
86
+ - Fixed camera configuration priority logic
87
+ - Fixed WebSocket connection state callback timing issues
88
+
89
+ ### 📚 Documentation
90
+
91
+ - Updated README.md with detailed explanation of three-layer architecture and two playback modes
92
+ - Added audio format requirements documentation (16kHz mono PCM16)
93
+ - Updated API reference documentation and code examples
94
+ - Added architecture diagrams and flowcharts
95
+
96
+ ### 🧪 Testing
97
+
98
+ - Updated unit tests to cover new architecture
99
+ - Added unit tests for external data mode
100
+ - Updated E2E tests to use new API
101
+ - All tests passing (69 unit tests + 24 E2E tests)
102
+
103
+ ### 🔄 Internal Changes
104
+
105
+ - Refactored `AvatarController` into unified playback layer
106
+ - Extracted `NetworkLayer` as independent component
107
+ - Optimized animation playback loop and audio-animation synchronization logic
108
+ - Updated WASM module (avatar_core_wasm.wasm)
109
+ - Improved error handling and logging
110
+
111
+ ### 📦 Dependencies
112
+
113
+ - No new dependencies added
114
+ - Maintained existing dependency versions
115
+
116
+ ---
117
+
118
+ ## [1.0.0-beta.2] - Previous Version
119
+
120
+ (Previous version changelog entries...)