lumiverse-spindle-types 0.6.45 → 0.6.46
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.
- package/dist/index.d.ts +1 -1
- package/dist/system-audio.d.ts +17 -5
- package/dist/system-audio.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,5 +28,5 @@ export type { CouncilMember, CouncilMemberContext, SidecarConfig, CouncilSidecar
|
|
|
28
28
|
export { SIDECAR_DEFAULTS, COUNCIL_SIDECAR_DEFAULTS, COUNCIL_TOOLS_DEFAULTS, COUNCIL_SETTINGS_DEFAULTS, } from "./council.js";
|
|
29
29
|
export type { SpindleSTTProvider, SpindleSTTProviderOption, SpindleSTTStatus, SpindleSTTResult, SpindleSTTAudioFrame, SpindleSTTTranscript, SpindleSTTPcmAudio, SpindleSTTOptions, SpindleSTTStartOptions, SpindleSTTSession, SpindleSTTAPI, } from "./speech-to-text.js";
|
|
30
30
|
export { SPINDLE_STT_HOST_CAPABILITIES } from "./speech-to-text.js";
|
|
31
|
-
export type { SpindleSystemAudioUnavailableReason, SpindleSystemAudioAvailability, SpindleSystemAudioFrame, SpindleSystemAudioEndReason, SpindleSystemAudioStartOptions, SpindleSystemAudioSession, SpindleSystemAudioAPI, } from "./system-audio.js";
|
|
31
|
+
export type { SpindleSystemAudioUnavailableReason, SpindleSystemAudioAvailability, SpindleSystemAudioFrame, SpindleSystemAudioChannelFrame, SpindleSystemAudioEndReason, SpindleSystemAudioStartOptions, SpindleSystemAudioSession, SpindleSystemAudioAPI, } from "./system-audio.js";
|
|
32
32
|
export { SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES } from "./system-audio.js";
|
package/dist/system-audio.d.ts
CHANGED
|
@@ -14,9 +14,11 @@ export type SpindleSystemAudioUnavailableReason =
|
|
|
14
14
|
export interface SpindleSystemAudioAvailability {
|
|
15
15
|
available: boolean;
|
|
16
16
|
unavailableReason?: SpindleSystemAudioUnavailableReason;
|
|
17
|
+
/** The native adapter supports stereo analysis. Missing means an older or unsupported client. */
|
|
18
|
+
stereoSupported?: boolean;
|
|
17
19
|
}
|
|
18
|
-
/** One analysis
|
|
19
|
-
export interface
|
|
20
|
+
/** One channel's analysis. Every number is normalised to 0 – 1. */
|
|
21
|
+
export interface SpindleSystemAudioChannelFrame {
|
|
20
22
|
/** Overall level (RMS). */
|
|
21
23
|
amplitude: number;
|
|
22
24
|
/** Loudest recent level. */
|
|
@@ -24,6 +26,13 @@ export interface SpindleSystemAudioFrame {
|
|
|
24
26
|
/** `bands` log-spaced magnitudes from about 40 Hz up to about 14 kHz, lowest first. */
|
|
25
27
|
frequencies: number[];
|
|
26
28
|
}
|
|
29
|
+
/** Combined analysis, with optional independent channels when stereo was requested. Never contains samples. */
|
|
30
|
+
export interface SpindleSystemAudioFrame extends SpindleSystemAudioChannelFrame {
|
|
31
|
+
stereo?: {
|
|
32
|
+
left: SpindleSystemAudioChannelFrame;
|
|
33
|
+
right: SpindleSystemAudioChannelFrame;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
27
36
|
/** Why a session ended without the extension calling `stop()`. */
|
|
28
37
|
export type SpindleSystemAudioEndReason = 'revoked' | 'user-stopped' | 'source-lost' | 'host-disabled';
|
|
29
38
|
export interface SpindleSystemAudioStartOptions {
|
|
@@ -31,6 +40,8 @@ export interface SpindleSystemAudioStartOptions {
|
|
|
31
40
|
bands?: number;
|
|
32
41
|
/** Most frames per second, 1 – 30 (default 30). The host clamps out-of-range values. */
|
|
33
42
|
maxFps?: number;
|
|
43
|
+
/** Add independent left/right analysis. Default false. Requires stereoSupported; otherwise ready rejects with NotSupportedError. */
|
|
44
|
+
stereo?: boolean;
|
|
34
45
|
signal?: AbortSignal;
|
|
35
46
|
onFrame(frame: SpindleSystemAudioFrame): void;
|
|
36
47
|
/** Called once if the host ends the session (permission revoked, the user pressed Stop on the host's indicator, the device went away). */
|
|
@@ -38,7 +49,7 @@ export interface SpindleSystemAudioStartOptions {
|
|
|
38
49
|
}
|
|
39
50
|
export interface SpindleSystemAudioSession {
|
|
40
51
|
/**
|
|
41
|
-
* Resolves when the
|
|
52
|
+
* Resolves when the host has verified explicit or remembered approval and analysis has begun. Rejects with a `NotAllowedError`
|
|
42
53
|
* `DOMException` if the user declines, `NotSupportedError` if unavailable, and `AbortError` if cancelled first.
|
|
43
54
|
*/
|
|
44
55
|
readonly ready: Promise<void>;
|
|
@@ -50,11 +61,12 @@ export interface SpindleSystemAudioAPI {
|
|
|
50
61
|
/** Free. Never prompts, and never opens anything. */
|
|
51
62
|
isAvailable(): SpindleSystemAudioAvailability;
|
|
52
63
|
/**
|
|
53
|
-
* Requires `system_audio`. Call
|
|
54
|
-
*
|
|
64
|
+
* Requires `system_audio`. Call the first start from a user gesture. The host checks explicit or remembered
|
|
65
|
+
* approval and shows an indicator for as long as analysis runs. One session per extension at a time.
|
|
55
66
|
*/
|
|
56
67
|
start(options: SpindleSystemAudioStartOptions): SpindleSystemAudioSession;
|
|
57
68
|
}
|
|
58
69
|
export declare const SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES: Readonly<{
|
|
59
70
|
'system-audio-v1': 1;
|
|
71
|
+
'system-audio-stereo-v1': 1;
|
|
60
72
|
}>;
|
package/dist/system-audio.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* `MediaStream`, or anything else from which what was played could be reconstructed. Available only where the host
|
|
6
6
|
* has a native adapter (the desktop client); feature-detect `system-audio-v1` and call `isAvailable()`.
|
|
7
7
|
*/
|
|
8
|
-
export const SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES = Object.freeze({ 'system-audio-v1': 1 });
|
|
8
|
+
export const SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES = Object.freeze({ 'system-audio-v1': 1, 'system-audio-stereo-v1': 1 });
|