@ikonai/sdk 0.0.14 → 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,40 +1,29 @@
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
  /**
31
24
  * Output format used by the mixing graph.
32
25
  */
33
26
  output?: IkonAudioOutputConfig;
34
- /**
35
- * Called when the browser requires a user gesture to start audio playback.
36
- */
37
- onAudioUnlockRequired?: () => void;
38
27
  /**
39
28
  * Worker and transport preferences.
40
29
  *
@@ -46,7 +35,6 @@ export interface IkonAudioPlaybackConfig {
46
35
  * All of these have fallbacks for restrictive embed environments.
47
36
  */
48
37
  threading?: {
49
- decodeWorker?: 'auto' | 'disabled';
50
38
  preferSharedArrayBuffer?: boolean;
51
39
  preferAudioWorklet?: boolean;
52
40
  preferWebCodecs?: boolean;
@@ -69,7 +57,6 @@ export declare class IkonAudioPlayback {
69
57
  private enabled;
70
58
  private prepared;
71
59
  private stateUnsubscribe;
72
- private unlockRequiredSignaled;
73
60
  private readonly isIos;
74
61
  private recreateOnNextResume;
75
62
  private boundVisibilityChange;
@@ -79,9 +66,12 @@ export declare class IkonAudioPlayback {
79
66
  /** Timeout for AudioContext.resume() - normally resolves instantly, but some browsers hang indefinitely */
80
67
  private static readonly RESUME_TIMEOUT_MS;
81
68
  private audioContext;
69
+ private outputSampleRateHz;
82
70
  private audioWorkletNode;
83
71
  private scriptProcessorNode;
72
+ private scriptDiagnosticsTimer;
84
73
  private workletModuleUrl;
74
+ private workletModuleKey;
85
75
  private workletReady;
86
76
  private pendingWorkletMessages;
87
77
  private audioWorker;
@@ -137,9 +127,12 @@ export declare class IkonAudioPlayback {
137
127
  * Some browsers return a Promise that never resolves in certain edge cases.
138
128
  */
139
129
  private resumeWithTimeout;
140
- private signalUnlockRequired;
141
130
  private ensureAudioWorklet;
142
131
  private ensureScriptProcessor;
132
+ private skipFromFallbackQueue;
133
+ private trimFallbackQueue;
134
+ private stopScriptProcessorDiagnostics;
135
+ private ensureScriptProcessorDiagnostics;
143
136
  private readFromFallbackQueue;
144
137
  private resumeAudioContextIfPossible;
145
138
  private recoverAudioContext;
@@ -13,12 +13,6 @@ export interface IkonImageCaptureResult {
13
13
  data: Uint8Array;
14
14
  }
15
15
  export declare class IkonImageCapture {
16
- private readonly requestUserGesture;
17
- constructor(requestUserGesture: (req: {
18
- kind: 'image';
19
- resume: () => void;
20
- cancel?: () => void;
21
- }) => void);
22
16
  private acquireCameraStream;
23
17
  captureFromCamera(request?: IkonImageCaptureRequest): Promise<IkonImageCaptureResult>;
24
18
  }
@@ -23,7 +23,6 @@ export declare class IkonVideoCapture {
23
23
  private ensureWorker;
24
24
  private ensurePorts;
25
25
  private getMediaStream;
26
- private acquireStreamWithGestureFallback;
27
26
  start(request: IkonVideoCaptureRequest): Promise<IkonVideoCaptureHandle>;
28
27
  startCamera(options?: Omit<IkonVideoCaptureRequest, 'source'>): Promise<IkonVideoCaptureHandle>;
29
28
  startScreen(options?: Omit<IkonVideoCaptureRequest, 'source'>): Promise<IkonVideoCaptureHandle>;
@@ -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.14",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",