@ikonai/sdk 0.0.15 → 0.0.16

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.
@@ -1,30 +1,23 @@
1
1
  import { IkonClient } from '../client/ikon-client';
2
2
  export interface IkonAudioOutputConfig {
3
3
  /**
4
- * Target output sample rate.
4
+ * Multi-stream normalization configuration.
5
5
  *
6
- * The browser ultimately controls the AudioContext sample rate, so this is best-effort.
7
- * The decode worker resamples into the actual output rate used by the playback graph.
6
+ * When enabled, normalizes mixed output by the number of active streams.
8
7
  */
9
- sampleRate?: number;
10
- /**
11
- * Target output channel count.
12
- *
13
- * This is used to normalize decoded streams into a single mixing format.
14
- */
15
- channels?: number;
16
- /**
17
- * Startup buffer size (seconds).
18
- *
19
- * This is the minimum buffered audio required before playback begins after a reset.
20
- */
21
- minBufferSizeSeconds?: number;
8
+ multiStreamNormalization?: {
9
+ enabled: boolean;
10
+ };
22
11
  /**
23
- * Maximum buffered audio (seconds).
12
+ * Audio debugging/diagnostics configuration.
24
13
  *
25
- * Larger buffers improve robustness under jitter but increase latency.
14
+ * When enabled, logs audio events and periodic status information.
26
15
  */
27
- maxBufferSizeSeconds?: number;
16
+ diagnostics?: {
17
+ enabled: boolean;
18
+ /** Interval for periodic status logs in seconds. Default: 5 */
19
+ statusInterval?: number;
20
+ };
28
21
  }
29
22
  export interface IkonAudioPlaybackConfig {
30
23
  /**
@@ -42,7 +35,6 @@ export interface IkonAudioPlaybackConfig {
42
35
  * All of these have fallbacks for restrictive embed environments.
43
36
  */
44
37
  threading?: {
45
- decodeWorker?: 'auto' | 'disabled';
46
38
  preferSharedArrayBuffer?: boolean;
47
39
  preferAudioWorklet?: boolean;
48
40
  preferWebCodecs?: boolean;
@@ -74,9 +66,12 @@ export declare class IkonAudioPlayback {
74
66
  /** Timeout for AudioContext.resume() - normally resolves instantly, but some browsers hang indefinitely */
75
67
  private static readonly RESUME_TIMEOUT_MS;
76
68
  private audioContext;
69
+ private outputSampleRateHz;
77
70
  private audioWorkletNode;
78
71
  private scriptProcessorNode;
72
+ private scriptDiagnosticsTimer;
79
73
  private workletModuleUrl;
74
+ private workletModuleKey;
80
75
  private workletReady;
81
76
  private pendingWorkletMessages;
82
77
  private audioWorker;
@@ -134,6 +129,10 @@ export declare class IkonAudioPlayback {
134
129
  private resumeWithTimeout;
135
130
  private ensureAudioWorklet;
136
131
  private ensureScriptProcessor;
132
+ private skipFromFallbackQueue;
133
+ private trimFallbackQueue;
134
+ private stopScriptProcessorDiagnostics;
135
+ private ensureScriptProcessorDiagnostics;
137
136
  private readFromFallbackQueue;
138
137
  private resumeAudioContextIfPossible;
139
138
  private recoverAudioContext;
@@ -7,7 +7,6 @@ export interface IkonVideoPlaybackConfig {
7
7
  * which avoids scheduling heavy work on the UI thread during high-frequency streaming.
8
8
  */
9
9
  threading?: {
10
- decodeWorker?: 'auto' | 'disabled';
11
10
  preferOffscreenCanvas?: boolean;
12
11
  };
13
12
  }
@@ -18,4 +18,5 @@ export declare class RingBuffer<TArray extends Float32Array = Float32Array> {
18
18
  availableWrite(): number;
19
19
  push(input: Float32Array): number;
20
20
  pop(target: Float32Array): number;
21
+ skip(count: number): number;
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",