@spatialwalk/avatarkit 1.0.0-beta.6 → 1.0.0-beta.61

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 (98) hide show
  1. package/CHANGELOG.md +499 -4
  2. package/README.md +267 -289
  3. package/dist/StreamingAudioPlayer-DIcPerS7.js +525 -0
  4. package/dist/animation/AnimationWebSocketClient.d.ts +9 -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 +4 -32
  8. package/dist/audio/StreamingAudioPlayer.d.ts +14 -75
  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 +1 -6
  12. package/dist/config/constants.d.ts +11 -25
  13. package/dist/config/sdk-config-loader.d.ts +4 -9
  14. package/dist/core/Avatar.d.ts +0 -14
  15. package/dist/core/AvatarController.d.ts +44 -116
  16. package/dist/core/AvatarDownloader.d.ts +0 -95
  17. package/dist/core/AvatarManager.d.ts +10 -18
  18. package/dist/core/AvatarSDK.d.ts +21 -0
  19. package/dist/core/AvatarView.d.ts +34 -110
  20. package/dist/core/NetworkLayer.d.ts +1 -59
  21. package/dist/generated/common/v1/models.d.ts +29 -0
  22. package/dist/generated/driveningress/v1/driveningress.d.ts +1 -12
  23. package/dist/generated/driveningress/v2/driveningress.d.ts +81 -3
  24. package/dist/generated/google/protobuf/struct.d.ts +5 -39
  25. package/dist/generated/google/protobuf/timestamp.d.ts +1 -103
  26. package/dist/index-jWgogoMs.js +14758 -0
  27. package/dist/index.d.ts +1 -6
  28. package/dist/index.js +17 -18
  29. package/dist/renderer/RenderSystem.d.ts +1 -79
  30. package/dist/renderer/covariance.d.ts +0 -12
  31. package/dist/renderer/renderer.d.ts +6 -2
  32. package/dist/renderer/sortSplats.d.ts +0 -11
  33. package/dist/renderer/webgl/reorderData.d.ts +0 -13
  34. package/dist/renderer/webgl/webglRenderer.d.ts +19 -42
  35. package/dist/renderer/webgpu/webgpuRenderer.d.ts +18 -31
  36. package/dist/types/character-settings.d.ts +1 -5
  37. package/dist/types/character.d.ts +3 -21
  38. package/dist/types/index.d.ts +91 -36
  39. package/dist/utils/animation-interpolation.d.ts +3 -13
  40. package/dist/utils/client-id.d.ts +1 -0
  41. package/dist/utils/conversationId.d.ts +1 -0
  42. package/dist/utils/error-utils.d.ts +1 -25
  43. package/dist/utils/id-manager.d.ts +38 -0
  44. package/dist/utils/logger.d.ts +5 -11
  45. package/dist/utils/posthog-tracker.d.ts +11 -0
  46. package/dist/utils/pwa-cache-manager.d.ts +16 -0
  47. package/dist/utils/usage-tracker.d.ts +5 -0
  48. package/dist/vanilla/vite.config.d.ts +2 -0
  49. package/dist/wasm/avatarCoreAdapter.d.ts +14 -99
  50. package/dist/wasm/avatarCoreMemory.d.ts +5 -54
  51. package/package.json +15 -13
  52. package/dist/StreamingAudioPlayer-BKTD97fl.js +0 -319
  53. package/dist/StreamingAudioPlayer-BKTD97fl.js.map +0 -1
  54. package/dist/animation/AnimationWebSocketClient.d.ts.map +0 -1
  55. package/dist/animation/utils/eventEmitter.d.ts.map +0 -1
  56. package/dist/animation/utils/flameConverter.d.ts.map +0 -1
  57. package/dist/audio/AnimationPlayer.d.ts.map +0 -1
  58. package/dist/audio/StreamingAudioPlayer.d.ts.map +0 -1
  59. package/dist/avatar_core_wasm-D4eEi7Eh.js +0 -1666
  60. package/dist/avatar_core_wasm-D4eEi7Eh.js.map +0 -1
  61. package/dist/config/app-config.d.ts.map +0 -1
  62. package/dist/config/constants.d.ts.map +0 -1
  63. package/dist/config/sdk-config-loader.d.ts.map +0 -1
  64. package/dist/core/Avatar.d.ts.map +0 -1
  65. package/dist/core/AvatarController.d.ts.map +0 -1
  66. package/dist/core/AvatarDownloader.d.ts.map +0 -1
  67. package/dist/core/AvatarKit.d.ts +0 -66
  68. package/dist/core/AvatarKit.d.ts.map +0 -1
  69. package/dist/core/AvatarManager.d.ts.map +0 -1
  70. package/dist/core/AvatarView.d.ts.map +0 -1
  71. package/dist/core/NetworkLayer.d.ts.map +0 -1
  72. package/dist/generated/driveningress/v1/driveningress.d.ts.map +0 -1
  73. package/dist/generated/driveningress/v2/driveningress.d.ts.map +0 -1
  74. package/dist/generated/google/protobuf/struct.d.ts.map +0 -1
  75. package/dist/generated/google/protobuf/timestamp.d.ts.map +0 -1
  76. package/dist/index-CX8f1bzw.js +0 -5946
  77. package/dist/index-CX8f1bzw.js.map +0 -1
  78. package/dist/index.d.ts.map +0 -1
  79. package/dist/index.js.map +0 -1
  80. package/dist/renderer/RenderSystem.d.ts.map +0 -1
  81. package/dist/renderer/covariance.d.ts.map +0 -1
  82. package/dist/renderer/renderer.d.ts.map +0 -1
  83. package/dist/renderer/sortSplats.d.ts.map +0 -1
  84. package/dist/renderer/webgl/reorderData.d.ts.map +0 -1
  85. package/dist/renderer/webgl/webglRenderer.d.ts.map +0 -1
  86. package/dist/renderer/webgpu/webgpuRenderer.d.ts.map +0 -1
  87. package/dist/types/character-settings.d.ts.map +0 -1
  88. package/dist/types/character.d.ts.map +0 -1
  89. package/dist/types/index.d.ts.map +0 -1
  90. package/dist/utils/animation-interpolation.d.ts.map +0 -1
  91. package/dist/utils/cls-tracker.d.ts +0 -17
  92. package/dist/utils/cls-tracker.d.ts.map +0 -1
  93. package/dist/utils/error-utils.d.ts.map +0 -1
  94. package/dist/utils/logger.d.ts.map +0 -1
  95. package/dist/utils/reqId.d.ts +0 -20
  96. package/dist/utils/reqId.d.ts.map +0 -1
  97. package/dist/wasm/avatarCoreAdapter.d.ts.map +0 -1
  98. package/dist/wasm/avatarCoreMemory.d.ts.map +0 -1
@@ -1,319 +0,0 @@
1
- var g = Object.defineProperty;
2
- var f = (h, t, e) => t in h ? g(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
- var i = (h, t, e) => f(h, typeof t != "symbol" ? t + "" : t, e);
4
- import { A as C, e as m, a as c, l as r } from "./index-CX8f1bzw.js";
5
- class A {
6
- constructor(t) {
7
- // AudioContext is managed internally
8
- i(this, "audioContext", null);
9
- i(this, "sampleRate");
10
- i(this, "channelCount");
11
- i(this, "debug");
12
- // Session-level state
13
- i(this, "sessionId");
14
- i(this, "sessionStartTime", 0);
15
- // AudioContext time when session started
16
- i(this, "pausedTimeOffset", 0);
17
- // Accumulated paused time
18
- i(this, "pausedAt", 0);
19
- // Time when paused
20
- i(this, "scheduledTime", 0);
21
- // Next chunk schedule time in AudioContext time
22
- // Playback state
23
- i(this, "isPlaying", !1);
24
- i(this, "isPaused", !1);
25
- i(this, "autoStartEnabled", !0);
26
- // Control whether to auto-start when buffer is ready
27
- // Audio buffer queue
28
- i(this, "audioChunks", []);
29
- i(this, "scheduledChunks", 0);
30
- // Number of chunks already scheduled
31
- i(this, "activeSources", []);
32
- // Event callbacks
33
- i(this, "onEndedCallback");
34
- this.sessionId = `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, this.sampleRate = (t == null ? void 0 : t.sampleRate) ?? C.audio.sampleRate, this.channelCount = (t == null ? void 0 : t.channelCount) ?? 1, this.debug = (t == null ? void 0 : t.debug) ?? !1;
35
- }
36
- /**
37
- * Initialize audio context (create and ensure it's ready)
38
- */
39
- async initialize() {
40
- if (!this.audioContext)
41
- try {
42
- this.audioContext = new AudioContext({
43
- sampleRate: this.sampleRate
44
- }), this.audioContext.state === "suspended" && await this.audioContext.resume(), this.log("AudioContext initialized", {
45
- sessionId: this.sessionId,
46
- sampleRate: this.audioContext.sampleRate,
47
- state: this.audioContext.state
48
- });
49
- } catch (t) {
50
- const e = m(t);
51
- throw c.logEvent("activeAudioSessionFailed", "warning", {
52
- sessionId: this.sessionId,
53
- reason: e
54
- }), r.error("Failed to initialize AudioContext:", e), t instanceof Error ? t : new Error(e);
55
- }
56
- }
57
- /**
58
- * Add audio chunk (16-bit PCM)
59
- */
60
- addChunk(t, e = !1) {
61
- if (!this.audioContext) {
62
- r.error("AudioContext not initialized");
63
- return;
64
- }
65
- this.audioChunks.push({ data: t, isLast: e }), this.log(`Added chunk ${this.audioChunks.length}`, {
66
- size: t.length,
67
- totalChunks: this.audioChunks.length,
68
- isLast: e,
69
- isPlaying: this.isPlaying,
70
- scheduledChunks: this.scheduledChunks
71
- }), !this.isPlaying && this.autoStartEnabled && this.audioChunks.length > 0 ? (this.log("[StreamingAudioPlayer] Auto-starting playback from addChunk"), this.startPlayback()) : this.isPlaying ? (this.log("[StreamingAudioPlayer] Already playing, scheduling next chunk"), this.scheduleNextChunk()) : this.log("[StreamingAudioPlayer] Not playing and no chunks, waiting for more chunks");
72
- }
73
- /**
74
- * Start new session (stop current and start fresh)
75
- */
76
- async startNewSession(t) {
77
- this.stop(), this.sessionId = `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, this.audioChunks = [], this.scheduledChunks = 0, this.pausedTimeOffset = 0, this.pausedAt = 0, this.log("Starting new session", {
78
- chunks: t.length
79
- });
80
- for (const e of t)
81
- this.addChunk(e.data, e.isLast);
82
- }
83
- /**
84
- * Start playback
85
- */
86
- startPlayback() {
87
- if (!this.audioContext) {
88
- this.log("[StreamingAudioPlayer] Cannot start playback: AudioContext not initialized");
89
- return;
90
- }
91
- if (this.isPlaying) {
92
- this.log("[StreamingAudioPlayer] Cannot start playback: Already playing");
93
- return;
94
- }
95
- this.isPlaying = !0, this.sessionStartTime = this.audioContext.currentTime, this.scheduledTime = this.sessionStartTime, this.log("[StreamingAudioPlayer] Starting playback", {
96
- sessionStartTime: this.sessionStartTime,
97
- bufferedChunks: this.audioChunks.length,
98
- scheduledChunks: this.scheduledChunks,
99
- activeSources: this.activeSources.length
100
- }), this.scheduleAllChunks();
101
- }
102
- /**
103
- * Schedule all pending chunks
104
- */
105
- scheduleAllChunks() {
106
- for (; this.scheduledChunks < this.audioChunks.length; )
107
- this.scheduleNextChunk();
108
- }
109
- /**
110
- * Schedule next audio chunk
111
- */
112
- scheduleNextChunk() {
113
- if (!this.audioContext) {
114
- this.log("[StreamingAudioPlayer] Cannot schedule chunk: AudioContext not initialized");
115
- return;
116
- }
117
- if (!this.isPlaying) {
118
- this.log("[StreamingAudioPlayer] Cannot schedule chunk: Not playing");
119
- return;
120
- }
121
- const t = this.scheduledChunks;
122
- if (t >= this.audioChunks.length) {
123
- this.log(`[StreamingAudioPlayer] No more chunks to schedule (chunkIndex: ${t}, totalChunks: ${this.audioChunks.length})`);
124
- return;
125
- }
126
- const e = this.audioChunks[t];
127
- if (e.data.length === 0 && !e.isLast) {
128
- this.scheduledChunks++;
129
- return;
130
- }
131
- const l = e.data, o = e.isLast, a = this.pcmToAudioBuffer(l);
132
- if (!a) {
133
- r.error("Failed to create AudioBuffer from PCM data"), c.logEvent("character_player", "error", {
134
- sessionId: this.sessionId,
135
- event: "audio_buffer_creation_failed"
136
- });
137
- return;
138
- }
139
- try {
140
- const s = this.audioContext.createBufferSource();
141
- s.buffer = a, s.connect(this.audioContext.destination), s.start(this.scheduledTime), this.activeSources.push(s), s.onended = () => {
142
- const u = this.activeSources.indexOf(s);
143
- u >= 0 && this.activeSources.splice(u, 1), o && this.activeSources.length === 0 && (this.log("Last audio chunk ended, marking playback as ended"), this.markEnded());
144
- }, this.scheduledTime += a.duration, this.scheduledChunks++, this.log(`[StreamingAudioPlayer] Scheduled chunk ${t + 1}/${this.audioChunks.length}`, {
145
- startTime: this.scheduledTime - a.duration,
146
- duration: a.duration,
147
- nextScheduleTime: this.scheduledTime,
148
- isLast: o,
149
- activeSources: this.activeSources.length
150
- });
151
- } catch (s) {
152
- r.errorWithError("Failed to schedule audio chunk:", s), c.logEvent("character_player", "error", {
153
- sessionId: this.sessionId,
154
- event: "schedule_chunk_failed",
155
- reason: s instanceof Error ? s.message : String(s)
156
- });
157
- }
158
- }
159
- /**
160
- * Convert PCM data to AudioBuffer
161
- * Input: 16-bit PCM (int16), Output: AudioBuffer (float32 [-1, 1])
162
- */
163
- pcmToAudioBuffer(t) {
164
- if (!this.audioContext)
165
- return null;
166
- if (t.length === 0) {
167
- const u = Math.floor(this.sampleRate * 0.01), n = this.audioContext.createBuffer(
168
- this.channelCount,
169
- u,
170
- this.sampleRate
171
- );
172
- for (let d = 0; d < this.channelCount; d++)
173
- n.getChannelData(d).fill(0);
174
- return n;
175
- }
176
- const e = new Uint8Array(t), l = new Int16Array(e.buffer, 0, e.length / 2), o = l.length / this.channelCount, a = this.audioContext.createBuffer(
177
- this.channelCount,
178
- o,
179
- this.sampleRate
180
- );
181
- for (let s = 0; s < this.channelCount; s++) {
182
- const u = a.getChannelData(s);
183
- for (let n = 0; n < o; n++) {
184
- const d = n * this.channelCount + s;
185
- u[n] = l[d] / 32768;
186
- }
187
- }
188
- return a;
189
- }
190
- /**
191
- * Get current playback time (seconds)
192
- */
193
- getCurrentTime() {
194
- if (!this.audioContext || !this.isPlaying)
195
- return 0;
196
- if (this.isPaused)
197
- return this.pausedAt;
198
- const e = this.audioContext.currentTime - this.sessionStartTime - this.pausedTimeOffset;
199
- return Math.max(0, e);
200
- }
201
- /**
202
- * Pause playback
203
- */
204
- pause() {
205
- !this.isPlaying || this.isPaused || (this.isPaused = !0, this.pausedAt = this.getCurrentTime(), this.log("Playback paused", {
206
- pausedAt: this.pausedAt
207
- }));
208
- }
209
- /**
210
- * Resume playback
211
- */
212
- async resume() {
213
- if (!this.isPaused || !this.audioContext)
214
- return;
215
- const t = this.audioContext.currentTime - (this.sessionStartTime + this.pausedAt);
216
- this.pausedTimeOffset += t, this.isPaused = !1, this.log("Playback resumed", {
217
- pauseDuration: t,
218
- totalPausedOffset: this.pausedTimeOffset
219
- });
220
- }
221
- /**
222
- * Stop playback
223
- */
224
- stop() {
225
- if (this.audioContext) {
226
- this.isPlaying = !1, this.isPaused = !1, this.sessionStartTime = 0, this.scheduledTime = 0;
227
- for (const t of this.activeSources) {
228
- t.onended = null;
229
- try {
230
- t.stop(0);
231
- } catch {
232
- }
233
- try {
234
- t.disconnect();
235
- } catch {
236
- }
237
- }
238
- this.activeSources = [], this.audioChunks = [], this.scheduledChunks = 0, this.log("[StreamingAudioPlayer] Playback stopped, state reset");
239
- }
240
- }
241
- /**
242
- * Enable or disable auto-start (for delayed start scenarios)
243
- */
244
- setAutoStart(t) {
245
- this.autoStartEnabled = t, this.log(`Auto-start ${t ? "enabled" : "disabled"}`);
246
- }
247
- /**
248
- * Start playback manually (for delayed start scenarios)
249
- * This allows starting playback after transition animation completes
250
- */
251
- play() {
252
- this.isPlaying || (this.autoStartEnabled = !0, this.startPlayback());
253
- }
254
- /**
255
- * Mark playback as ended
256
- */
257
- markEnded() {
258
- var t;
259
- this.log("Playback ended"), this.isPlaying = !1, (t = this.onEndedCallback) == null || t.call(this);
260
- }
261
- /**
262
- * Set ended callback
263
- */
264
- onEnded(t) {
265
- this.onEndedCallback = t;
266
- }
267
- /**
268
- * Check if playing
269
- */
270
- isPlayingNow() {
271
- return this.isPlaying && !this.isPaused;
272
- }
273
- /**
274
- * Get total duration of buffered audio
275
- */
276
- getBufferedDuration() {
277
- if (!this.audioContext)
278
- return 0;
279
- let t = 0;
280
- for (const e of this.audioChunks)
281
- t += e.data.length / 2 / this.channelCount;
282
- return t / this.sampleRate;
283
- }
284
- /**
285
- * Get remaining duration (buffered - played) in seconds
286
- */
287
- getRemainingDuration() {
288
- const t = this.getBufferedDuration(), e = this.getCurrentTime();
289
- return Math.max(0, t - e);
290
- }
291
- /**
292
- * Dispose and cleanup
293
- */
294
- dispose() {
295
- this.stop(), this.audioContext && (this.audioContext.close(), this.audioContext = null), this.audioChunks = [], this.scheduledChunks = 0, this.sessionStartTime = 0, this.pausedTimeOffset = 0, this.pausedAt = 0, this.scheduledTime = 0, this.onEndedCallback = void 0, this.log("StreamingAudioPlayer disposed");
296
- }
297
- /**
298
- * Flush buffered audio
299
- * - hard: stops all playing sources and clears all chunks
300
- * - soft (default): clears UNSCHEDULED chunks only
301
- */
302
- flush(t) {
303
- if ((t == null ? void 0 : t.hard) === !0) {
304
- this.stop(), this.audioChunks = [], this.scheduledChunks = 0, this.sessionStartTime = 0, this.pausedAt = 0, this.scheduledTime = 0, this.log("Flushed (hard)");
305
- return;
306
- }
307
- this.scheduledChunks < this.audioChunks.length && this.audioChunks.splice(this.scheduledChunks), this.log("Flushed (soft)", { remainingScheduled: this.scheduledChunks });
308
- }
309
- /**
310
- * Debug logging
311
- */
312
- log(t, e) {
313
- this.debug && r.log(`[StreamingAudioPlayer] ${t}`, e || "");
314
- }
315
- }
316
- export {
317
- A as StreamingAudioPlayer
318
- };
319
- //# sourceMappingURL=StreamingAudioPlayer-BKTD97fl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StreamingAudioPlayer-BKTD97fl.js","sources":["../audio/StreamingAudioPlayer.ts"],"sourcesContent":["/**\n * Streaming Audio Player\n * Implements real-time audio playback using Web Audio API\n * Supports dynamic PCM chunk addition without Workers\n */\n\nimport { APP_CONFIG } from '../config/app-config'\nimport { AvatarKit } from '../core/AvatarKit'\nimport { errorToMessage } from '../utils/error-utils'\nimport { logger } from '../utils/logger'\n\nexport interface StreamingAudioPlayerOptions {\n sampleRate?: number // PCM sample rate (default: APP_CONFIG.audio.sampleRate, backend requires 16kHz)\n channelCount?: number // Number of channels (default: 1)\n debug?: boolean\n}\n\nexport class StreamingAudioPlayer {\n // AudioContext is managed internally\n private audioContext: AudioContext | null = null\n private sampleRate: number\n private channelCount: number\n private debug: boolean\n\n // Session-level state\n private sessionId: string\n private sessionStartTime = 0 // AudioContext time when session started\n private pausedTimeOffset = 0 // Accumulated paused time\n private pausedAt = 0 // Time when paused\n private scheduledTime = 0 // Next chunk schedule time in AudioContext time\n\n // Playback state\n private isPlaying = false\n private isPaused = false\n private autoStartEnabled = true // Control whether to auto-start when buffer is ready\n\n // Audio buffer queue\n private audioChunks: Array<{ data: Uint8Array, isLast: boolean }> = []\n private scheduledChunks = 0 // Number of chunks already scheduled\n private activeSources: AudioBufferSourceNode[] = []\n\n // Event callbacks\n private onEndedCallback?: () => void\n\n constructor(options?: StreamingAudioPlayerOptions) {\n this.sessionId = `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`\n this.sampleRate = options?.sampleRate ?? APP_CONFIG.audio.sampleRate\n this.channelCount = options?.channelCount ?? 1\n this.debug = options?.debug ?? false\n }\n\n /**\n * Initialize audio context (create and ensure it's ready)\n */\n async initialize(): Promise<void> {\n if (this.audioContext) {\n return\n }\n\n try {\n // Create AudioContext\n this.audioContext = new AudioContext({\n sampleRate: this.sampleRate,\n })\n\n // Resume context (required for some browsers)\n if (this.audioContext.state === 'suspended') {\n await this.audioContext.resume()\n }\n\n this.log('AudioContext initialized', {\n sessionId: this.sessionId,\n sampleRate: this.audioContext.sampleRate,\n state: this.audioContext.state,\n })\n }\n catch (error) {\n const message = errorToMessage(error)\n AvatarKit.logEvent('activeAudioSessionFailed', 'warning', {\n sessionId: this.sessionId,\n reason: message,\n })\n logger.error('Failed to initialize AudioContext:', message)\n throw error instanceof Error ? error : new Error(message)\n }\n }\n\n /**\n * Add audio chunk (16-bit PCM)\n */\n addChunk(pcmData: Uint8Array, isLast: boolean = false): void {\n if (!this.audioContext) {\n logger.error('AudioContext not initialized')\n return\n }\n\n // Store chunk with metadata\n this.audioChunks.push({ data: pcmData, isLast })\n\n // Track buffer underrun warning\n if (this.isPlaying && this.audioChunks.length === this.scheduledChunks) {\n // Buffer underrun detected - chunks consumed faster than added\n }\n\n this.log(`Added chunk ${this.audioChunks.length}`, {\n size: pcmData.length,\n totalChunks: this.audioChunks.length,\n isLast,\n isPlaying: this.isPlaying,\n scheduledChunks: this.scheduledChunks,\n })\n\n // Auto-start if we have any audio chunks and auto-start is enabled\n if (!this.isPlaying && this.autoStartEnabled && this.audioChunks.length > 0) {\n this.log('[StreamingAudioPlayer] Auto-starting playback from addChunk')\n this.startPlayback()\n }\n // Schedule next chunk if already playing\n else if (this.isPlaying) {\n this.log('[StreamingAudioPlayer] Already playing, scheduling next chunk')\n this.scheduleNextChunk()\n } else {\n this.log('[StreamingAudioPlayer] Not playing and no chunks, waiting for more chunks')\n }\n }\n\n /**\n * Start new session (stop current and start fresh)\n */\n async startNewSession(audioChunks: Array<{ data: Uint8Array, isLast: boolean }>): Promise<void> {\n // Stop current session if playing\n this.stop()\n\n // Generate new session ID to prevent data mixing\n this.sessionId = `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`\n\n // Reset session state\n this.audioChunks = []\n this.scheduledChunks = 0\n this.pausedTimeOffset = 0\n this.pausedAt = 0\n // Don't set sessionStartTime or scheduledTime here - let startPlayback() set them\n this.log('Starting new session', {\n chunks: audioChunks.length,\n })\n\n // Add audio chunks with their metadata\n for (const chunk of audioChunks) {\n this.addChunk(chunk.data, chunk.isLast)\n }\n }\n\n /**\n * Start playback\n */\n private startPlayback(): void {\n if (!this.audioContext) {\n this.log('[StreamingAudioPlayer] Cannot start playback: AudioContext not initialized')\n return\n }\n if (this.isPlaying) {\n this.log('[StreamingAudioPlayer] Cannot start playback: Already playing')\n return\n }\n\n this.isPlaying = true\n this.sessionStartTime = this.audioContext.currentTime\n this.scheduledTime = this.sessionStartTime\n\n this.log('[StreamingAudioPlayer] Starting playback', {\n sessionStartTime: this.sessionStartTime,\n bufferedChunks: this.audioChunks.length,\n scheduledChunks: this.scheduledChunks,\n activeSources: this.activeSources.length,\n })\n\n // Schedule all available chunks\n this.scheduleAllChunks()\n }\n\n /**\n * Schedule all pending chunks\n */\n private scheduleAllChunks(): void {\n while (this.scheduledChunks < this.audioChunks.length) {\n this.scheduleNextChunk()\n }\n }\n\n /**\n * Schedule next audio chunk\n */\n private scheduleNextChunk(): void {\n if (!this.audioContext) {\n this.log('[StreamingAudioPlayer] Cannot schedule chunk: AudioContext not initialized')\n return\n }\n if (!this.isPlaying) {\n this.log('[StreamingAudioPlayer] Cannot schedule chunk: Not playing')\n return\n }\n\n const chunkIndex = this.scheduledChunks\n if (chunkIndex >= this.audioChunks.length) {\n this.log(`[StreamingAudioPlayer] No more chunks to schedule (chunkIndex: ${chunkIndex}, totalChunks: ${this.audioChunks.length})`)\n return\n }\n\n const chunk = this.audioChunks[chunkIndex]\n\n // 当音频块为空且不是最后一个块时,跳过调度\n if (chunk.data.length === 0 && !chunk.isLast) {\n this.scheduledChunks++\n return\n }\n\n const pcmData = chunk.data\n const isLast = chunk.isLast\n const audioBuffer = this.pcmToAudioBuffer(pcmData)\n\n if (!audioBuffer) {\n const errorMessage = 'Failed to create AudioBuffer from PCM data'\n logger.error(errorMessage)\n AvatarKit.logEvent('character_player', 'error', {\n sessionId: this.sessionId,\n event: 'audio_buffer_creation_failed',\n })\n return\n }\n\n try {\n // Create and configure source node\n const source = this.audioContext.createBufferSource()\n source.buffer = audioBuffer\n source.connect(this.audioContext.destination)\n\n // Schedule playback\n source.start(this.scheduledTime)\n\n // Track active source for hard-cancel\n this.activeSources.push(source)\n source.onended = () => {\n // Remove from active list when it ends\n const idx = this.activeSources.indexOf(source)\n if (idx >= 0)\n this.activeSources.splice(idx, 1)\n\n // Check if this was the last chunk and all sources have ended\n if (isLast && this.activeSources.length === 0) {\n this.log('Last audio chunk ended, marking playback as ended')\n this.markEnded()\n }\n }\n\n // Update scheduled time for next chunk\n this.scheduledTime += audioBuffer.duration\n\n this.scheduledChunks++\n\n this.log(`[StreamingAudioPlayer] Scheduled chunk ${chunkIndex + 1}/${this.audioChunks.length}`, {\n startTime: this.scheduledTime - audioBuffer.duration,\n duration: audioBuffer.duration,\n nextScheduleTime: this.scheduledTime,\n isLast,\n activeSources: this.activeSources.length,\n })\n }\n catch (err) {\n logger.errorWithError('Failed to schedule audio chunk:', err)\n AvatarKit.logEvent('character_player', 'error', {\n sessionId: this.sessionId,\n event: 'schedule_chunk_failed',\n reason: err instanceof Error ? err.message : String(err),\n })\n }\n }\n\n /**\n * Convert PCM data to AudioBuffer\n * Input: 16-bit PCM (int16), Output: AudioBuffer (float32 [-1, 1])\n */\n private pcmToAudioBuffer(pcmData: Uint8Array): AudioBuffer | null {\n if (!this.audioContext) {\n return null\n }\n\n // Handle empty PCM data (e.g., when isLast is true)\n if (pcmData.length === 0) {\n // For empty chunks (typically the last chunk), create minimal silence\n // Use a very short duration to avoid playback stuttering\n const silenceDuration = 0.01 // 1ms - minimal silence to maintain timing\n const numSamples = Math.floor(this.sampleRate * silenceDuration)\n\n const audioBuffer = this.audioContext.createBuffer(\n this.channelCount,\n numSamples,\n this.sampleRate,\n )\n\n // Fill with silence (all zeros)\n for (let channel = 0; channel < this.channelCount; channel++) {\n const channelData = audioBuffer.getChannelData(channel)\n channelData.fill(0) // Fill with silence\n }\n\n return audioBuffer\n }\n\n // Create aligned copy to avoid byte offset issues\n // Int16Array requires byteOffset to be a multiple of 2\n const alignedData = new Uint8Array(pcmData)\n const int16Array = new Int16Array(alignedData.buffer, 0, alignedData.length / 2)\n\n // Calculate number of samples\n const numSamples = int16Array.length / this.channelCount\n\n // Create AudioBuffer\n const audioBuffer = this.audioContext.createBuffer(\n this.channelCount,\n numSamples,\n this.sampleRate,\n )\n\n // Convert int16 to float32 [-1, 1]\n for (let channel = 0; channel < this.channelCount; channel++) {\n const channelData = audioBuffer.getChannelData(channel)\n\n for (let i = 0; i < numSamples; i++) {\n const sampleIndex = i * this.channelCount + channel\n // Normalize int16 (-32768 to 32767) to float32 (-1 to 1)\n channelData[i] = int16Array[sampleIndex] / 32768.0\n }\n }\n\n return audioBuffer\n }\n\n /**\n * Get current playback time (seconds)\n */\n getCurrentTime(): number {\n if (!this.audioContext || !this.isPlaying) {\n return 0\n }\n\n if (this.isPaused) {\n return this.pausedAt\n }\n\n // Calculate elapsed time using session start time and paused offset\n const currentAudioTime = this.audioContext.currentTime\n const elapsed = currentAudioTime - this.sessionStartTime - this.pausedTimeOffset\n\n return Math.max(0, elapsed)\n }\n\n /**\n * Pause playback\n */\n pause(): void {\n if (!this.isPlaying || this.isPaused) {\n return\n }\n\n this.isPaused = true\n this.pausedAt = this.getCurrentTime()\n\n // Don't suspend AudioContext to maintain time continuity\n // Just mark as paused and stop scheduling new chunks\n this.log('Playback paused', {\n pausedAt: this.pausedAt,\n })\n }\n\n /**\n * Resume playback\n */\n async resume(): Promise<void> {\n if (!this.isPaused || !this.audioContext) {\n return\n }\n\n // Calculate paused duration and add to offset\n const pauseDuration = this.audioContext.currentTime - (this.sessionStartTime + this.pausedAt)\n this.pausedTimeOffset += pauseDuration\n\n this.isPaused = false\n\n this.log('Playback resumed', {\n pauseDuration,\n totalPausedOffset: this.pausedTimeOffset,\n })\n }\n\n /**\n * Stop playback\n */\n stop(): void {\n if (!this.audioContext) {\n return\n }\n\n this.isPlaying = false\n this.isPaused = false\n this.sessionStartTime = 0 // Reset session start time\n this.scheduledTime = 0 // Reset scheduled time for next session\n\n // Hard stop all scheduled sources immediately\n for (const source of this.activeSources) {\n source.onended = null\n try {\n source.stop(0)\n }\n catch {}\n try {\n source.disconnect()\n }\n catch {}\n }\n this.activeSources = []\n\n // 清理音频块和调度状态,确保下次播放时状态干净\n this.audioChunks = []\n this.scheduledChunks = 0\n\n this.log('[StreamingAudioPlayer] Playback stopped, state reset')\n\n // Note: Individual source nodes will stop automatically\n // We just reset our state\n }\n\n /**\n * Enable or disable auto-start (for delayed start scenarios)\n */\n setAutoStart(enabled: boolean): void {\n this.autoStartEnabled = enabled\n this.log(`Auto-start ${enabled ? 'enabled' : 'disabled'}`)\n }\n\n /**\n * Start playback manually (for delayed start scenarios)\n * This allows starting playback after transition animation completes\n */\n play(): void {\n if (this.isPlaying) {\n return\n }\n // Enable auto-start when manually starting playback\n this.autoStartEnabled = true\n this.startPlayback()\n }\n\n /**\n * Mark playback as ended\n */\n markEnded(): void {\n this.log('Playback ended')\n this.isPlaying = false\n this.onEndedCallback?.()\n }\n\n /**\n * Set ended callback\n */\n onEnded(callback: () => void): void {\n this.onEndedCallback = callback\n }\n\n /**\n * Check if playing\n */\n isPlayingNow(): boolean {\n return this.isPlaying && !this.isPaused\n }\n\n /**\n * Get total duration of buffered audio\n */\n getBufferedDuration(): number {\n if (!this.audioContext) {\n return 0\n }\n\n let totalSamples = 0\n for (const chunk of this.audioChunks) {\n totalSamples += chunk.data.length / 2 / this.channelCount // 16-bit = 2 bytes per sample\n }\n\n return totalSamples / this.sampleRate\n }\n\n /**\n * Get remaining duration (buffered - played) in seconds\n */\n getRemainingDuration(): number {\n const total = this.getBufferedDuration()\n const played = this.getCurrentTime()\n return Math.max(0, total - played)\n }\n\n\n /**\n * Dispose and cleanup\n */\n dispose(): void {\n this.stop()\n\n // Close AudioContext\n if (this.audioContext) {\n this.audioContext.close()\n this.audioContext = null\n }\n\n // Clear session state\n this.audioChunks = []\n this.scheduledChunks = 0\n this.sessionStartTime = 0\n this.pausedTimeOffset = 0\n this.pausedAt = 0\n this.scheduledTime = 0\n this.onEndedCallback = undefined\n\n this.log('StreamingAudioPlayer disposed')\n }\n\n /**\n * Flush buffered audio\n * - hard: stops all playing sources and clears all chunks\n * - soft (default): clears UNSCHEDULED chunks only\n */\n flush(options?: { hard?: boolean }): void {\n const hard = options?.hard === true\n if (hard) {\n this.stop()\n this.audioChunks = []\n this.scheduledChunks = 0\n this.sessionStartTime = 0\n this.pausedAt = 0\n this.scheduledTime = 0\n this.log('Flushed (hard)')\n return\n }\n\n // Soft flush: drop unscheduled region\n if (this.scheduledChunks < this.audioChunks.length) {\n this.audioChunks.splice(this.scheduledChunks)\n }\n this.log('Flushed (soft)', { remainingScheduled: this.scheduledChunks })\n }\n\n /**\n * Debug logging\n */\n private log(message: string, data?: unknown): void {\n if (this.debug) {\n logger.log(`[StreamingAudioPlayer] ${message}`, data || '')\n }\n }\n}\n"],"names":["StreamingAudioPlayer","options","__publicField","APP_CONFIG","error","message","errorToMessage","AvatarKit","logger","pcmData","isLast","audioChunks","chunk","chunkIndex","audioBuffer","source","idx","err","numSamples","channel","alignedData","int16Array","channelData","i","sampleIndex","elapsed","pauseDuration","enabled","_a","callback","totalSamples","total","played","data"],"mappings":";;;;AAiBO,MAAMA,EAAqB;AAAA,EA2BhC,YAAYC,GAAuC;AAzB3C;AAAA,IAAAC,EA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K,oBAAA,GACbC,IAAS,KAAK,eAAA;AACpB,WAAO,KAAK,IAAI,GAAGD,IAAQC,CAAM;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA,EAMA,UAAgB;AACd,SAAK,KAAA,GAGD,KAAK,iBACP,KAAK,aAAa,MAAA,GAClB,KAAK,eAAe,OAItB,KAAK,cAAc,CAAA,GACnB,KAAK,kBAAkB,GACvB,KAAK,mBAAmB,GACxB,KAAK,mBAAmB,GACxB,KAAK,WAAW,GAChB,KAAK,gBAAgB,GACrB,KAAK,kBAAkB,QAEvB,KAAK,IAAI,+BAA+B;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM/B,GAAoC;AAExC,SADaA,KAAA,gBAAAA,EAAS,UAAS,IACrB;AACR,WAAK,KAAA,GACL,KAAK,cAAc,CAAA,GACnB,KAAK,kBAAkB,GACvB,KAAK,mBAAmB,GACxB,KAAK,WAAW,GAChB,KAAK,gBAAgB,GACrB,KAAK,IAAI,gBAAgB;AACzB;AAAA,IACF;AAGA,IAAI,KAAK,kBAAkB,KAAK,YAAY,UAC1C,KAAK,YAAY,OAAO,KAAK,eAAe,GAE9C,KAAK,IAAI,kBAAkB,EAAE,oBAAoB,KAAK,iBAAiB;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA,EAKQ,IAAII,GAAiB4B,GAAsB;AACjD,IAAI,KAAK,SACPzB,EAAO,IAAI,0BAA0BH,CAAO,IAAI4B,KAAQ,EAAE;AAAA,EAE9D;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnimationWebSocketClient.d.ts","sourceRoot":"","sources":["../../animation/AnimationWebSocketClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,CAAC,E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AO9C,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAW/C,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAOzC,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAQzC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"flameConverter.d.ts","sourceRoot":"","sources":["../../../animation/utils/flameConverter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gDAAgD,CAAA;AAE3E,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,KAAK,GAAG,WAAW,CAY5E;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,WAAW,GAAG,KAAK,CAU5E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,KAAK,CAU/C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnimationPlayer.d.ts","sourceRoot":"","sources":["../../audio/AnimationPlayer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAMlE,qBAAa,eAAe;IAC1B,OAAO,CAAC,KAAK,CA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