@nonstrict/recordkit 0.87.2 → 0.97.1
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/bin/README.md +1 -1
- package/bin/recordkit-rpc +0 -0
- package/out/Errors.d.ts +91 -0
- package/out/Errors.js +63 -0
- package/out/Errors.js.map +1 -0
- package/out/InputEvents.d.ts +661 -0
- package/out/InputEvents.js +8 -0
- package/out/InputEvents.js.map +1 -0
- package/out/IpcRecordKit.js +13 -0
- package/out/IpcRecordKit.js.map +1 -1
- package/out/NonstrictRPC.d.ts +9 -0
- package/out/NonstrictRPC.js +27 -4
- package/out/NonstrictRPC.js.map +1 -1
- package/out/RecordKit.d.ts +267 -5
- package/out/RecordKit.js +243 -3
- package/out/RecordKit.js.map +1 -1
- package/out/Recorder.d.ts +451 -53
- package/out/Recorder.js +80 -2
- package/out/Recorder.js.map +1 -1
- package/out/RecordingMetadata.d.ts +96 -0
- package/out/RecordingMetadata.js +12 -0
- package/out/RecordingMetadata.js.map +1 -0
- package/out/WebAudioUtils.d.ts +35 -0
- package/out/WebAudioUtils.js +37 -0
- package/out/WebAudioUtils.js.map +1 -1
- package/out/WindowLevels.d.ts +46 -0
- package/out/WindowLevels.js +41 -0
- package/out/WindowLevels.js.map +1 -0
- package/out/browser.d.ts +8 -1
- package/out/browser.js +3 -1
- package/out/browser.js.map +1 -1
- package/out/index.cjs +603 -9
- package/out/index.cjs.map +1 -1
- package/out/index.d.ts +8 -0
- package/out/index.js +3 -0
- package/out/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Errors.test.ts +38 -0
- package/src/Errors.ts +151 -0
- package/src/InputEvents.ts +695 -0
- package/src/IpcRecordKit.ts +12 -0
- package/src/NonstrictRPC.test.ts +24 -1
- package/src/NonstrictRPC.ts +29 -5
- package/src/RecordKit.ts +347 -11
- package/src/Recorder.schema.test.ts +167 -0
- package/src/Recorder.ts +558 -80
- package/src/RecordingMetadata.ts +125 -0
- package/src/WebAudioUtils.test.ts +78 -0
- package/src/WebAudioUtils.ts +57 -1
- package/src/WindowLevels.test.ts +34 -0
- package/src/WindowLevels.ts +47 -0
- package/src/browser.ts +12 -2
- package/src/index.ts +8 -0
- package/src/__snapshots__/NonstrictRPC.test.ts.snap +0 -24
package/out/Recorder.js
CHANGED
|
@@ -41,6 +41,21 @@ function convertRPCParamsToAudioStreamBuffer(params) {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Registers the per-segment callback of a {@link JSONOutputOptions} (if any) as an RPC closure,
|
|
46
|
+
* replacing the function with the closure target so the options object can be serialized.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
function registerJSONOutputSegmentCallback(output, rpc, object, prefix) {
|
|
50
|
+
if (output && output.output == 'segmented' && output.segmentCallback) {
|
|
51
|
+
const segmentHandler = output.segmentCallback;
|
|
52
|
+
output.segmentCallback = rpc.registerClosure({
|
|
53
|
+
handler: (params) => { segmentHandler(params.path); },
|
|
54
|
+
prefix,
|
|
55
|
+
lifecycle: object
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
44
59
|
/**
|
|
45
60
|
* @group Recording
|
|
46
61
|
*/
|
|
@@ -80,6 +95,7 @@ export class Recorder extends EventEmitter {
|
|
|
80
95
|
lifecycle: object
|
|
81
96
|
});
|
|
82
97
|
}
|
|
98
|
+
registerJSONOutputSegmentCallback(item.inputEventsOutput, rpc, object, 'Display.onInputEventsSegment');
|
|
83
99
|
}
|
|
84
100
|
if (item.type == 'windowBasedCrop') {
|
|
85
101
|
if (typeof item.window != 'number') {
|
|
@@ -93,6 +109,21 @@ export class Recorder extends EventEmitter {
|
|
|
93
109
|
lifecycle: object
|
|
94
110
|
});
|
|
95
111
|
}
|
|
112
|
+
registerJSONOutputSegmentCallback(item.inputEventsOutput, rpc, object, 'WindowBasedCrop.onInputEventsSegment');
|
|
113
|
+
}
|
|
114
|
+
if (item.type == 'desktopIndependentWindow') {
|
|
115
|
+
if (typeof item.window != 'number') {
|
|
116
|
+
item.window = item.window.id;
|
|
117
|
+
}
|
|
118
|
+
if (item.output == 'segmented' && item.segmentCallback) {
|
|
119
|
+
const segmentHandler = item.segmentCallback;
|
|
120
|
+
item.segmentCallback = rpc.registerClosure({
|
|
121
|
+
handler: (params) => { segmentHandler(params.path); },
|
|
122
|
+
prefix: 'DesktopIndependentWindow.onSegment',
|
|
123
|
+
lifecycle: object
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
registerJSONOutputSegmentCallback(item.inputEventsOutput, rpc, object, 'DesktopIndependentWindow.onInputEventsSegment');
|
|
96
127
|
}
|
|
97
128
|
if (item.type == 'appleDeviceStaticOrientation') {
|
|
98
129
|
if (typeof item.device != 'string') {
|
|
@@ -183,10 +214,15 @@ export class Recorder extends EventEmitter {
|
|
|
183
214
|
prefix: 'Recorder.onAbort',
|
|
184
215
|
lifecycle: object
|
|
185
216
|
});
|
|
217
|
+
const onSignalsChangedInstance = rpc.registerClosure({
|
|
218
|
+
handler: (params) => { weakRefObject.deref()?.emit('signals', params.signals); },
|
|
219
|
+
prefix: 'Recorder.onSignalsChanged',
|
|
220
|
+
lifecycle: object
|
|
221
|
+
});
|
|
186
222
|
await rpc.initialize({
|
|
187
223
|
target,
|
|
188
224
|
type: 'Recorder',
|
|
189
|
-
params: { schema, onAbortInstance },
|
|
225
|
+
params: { schema, onAbortInstance, onSignalsChangedInstance },
|
|
190
226
|
lifecycle: object
|
|
191
227
|
});
|
|
192
228
|
return object;
|
|
@@ -197,15 +233,57 @@ export class Recorder extends EventEmitter {
|
|
|
197
233
|
this.rpc = rpc;
|
|
198
234
|
this.target = target;
|
|
199
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Prepares the recording session for instant recording, allocating resources and validating the
|
|
238
|
+
* configuration.
|
|
239
|
+
*
|
|
240
|
+
* Preparing ahead of time lets {@link start} begin recording instantly; without it, starting incurs
|
|
241
|
+
* a setup delay.
|
|
242
|
+
*
|
|
243
|
+
* @returns The expected {@link BundleInfo} describing the file assets that will be produced by this
|
|
244
|
+
* recording, allowing you to inspect the planned output (filenames, asset types, sizes) before
|
|
245
|
+
* recording starts.
|
|
246
|
+
*/
|
|
200
247
|
async prepare() {
|
|
201
|
-
await this.rpc.perform({ target: this.target, action: 'prepare' });
|
|
248
|
+
return await this.rpc.perform({ target: this.target, action: 'prepare' });
|
|
202
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Starts recording. If the session was not already {@link prepare}d this performs setup first,
|
|
252
|
+
* incurring a short delay; call {@link prepare} ahead of time to start instantly.
|
|
253
|
+
*/
|
|
203
254
|
async start() {
|
|
204
255
|
await this.rpc.perform({ target: this.target, action: 'start' });
|
|
205
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Pauses the recording. The capture hardware remains active so recording can be resumed quickly.
|
|
259
|
+
*
|
|
260
|
+
* Call {@link resume} to continue recording, or {@link stop} to finish.
|
|
261
|
+
*/
|
|
262
|
+
async pause() {
|
|
263
|
+
await this.rpc.perform({ target: this.target, action: 'pause' });
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Resumes a recording that was previously paused with {@link pause}.
|
|
267
|
+
*/
|
|
268
|
+
async resume() {
|
|
269
|
+
await this.rpc.perform({ target: this.target, action: 'resume' });
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Stops the recording, finalizes the output files, and returns the {@link RecordingResult}
|
|
273
|
+
* describing the completed bundle. The recorder cannot be reused after stopping.
|
|
274
|
+
*
|
|
275
|
+
* @remarks Known limitation: when the recording failed, the returned promise rejects with the
|
|
276
|
+
* failure but the partial recording result is not available over the RPC bridge (the Swift API
|
|
277
|
+
* surfaces it as `PartialResultError`). Any partially-written files do remain on disk in the
|
|
278
|
+
* bundle inside the schema's `output_directory`.
|
|
279
|
+
*/
|
|
206
280
|
async stop() {
|
|
207
281
|
return await this.rpc.perform({ target: this.target, action: 'stop' });
|
|
208
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Cancels the recording and releases its resources without finalizing output. Use this to discard
|
|
285
|
+
* an in-progress or prepared recording; call {@link stop} instead to keep the result.
|
|
286
|
+
*/
|
|
209
287
|
async cancel() {
|
|
210
288
|
await this.rpc.manualRelease(this.target);
|
|
211
289
|
}
|
package/out/Recorder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Recorder.js","sourceRoot":"","sources":["../src/Recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Recorder.js","sourceRoot":"","sources":["../src/Recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAItC;;;GAGG;AACH,SAAS,mCAAmC,CAAC,MAAW;IACtD,IAAI,CAAC;QACH,oDAAoD;QACpD,MAAM,cAAc,GAAG,MAAa,CAAC;QAErC,IAAI,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,WAAW,GAAmB,EAAE,CAAC;QAEvC,KAAK,MAAM,UAAU,IAAI,cAAc,CAAC,WAAW,EAAE,CAAC;YACpD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;gBACnC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;gBACzD,OAAO,IAAI,CAAC;YACd,CAAC;YAED,+BAA+B;YAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;YACtC,MAAM,KAAK,GAAG,IAAI,UAAU,CAA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AO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAe,CAAC;IAC1F,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI;QACR,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAoB,CAAC;IAC5F,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { EventTime } from './InputEvents.js';
|
|
2
|
+
/**
|
|
3
|
+
* Presence of a window at a point in time within a recording.
|
|
4
|
+
*
|
|
5
|
+
* Encoded as a flat object discriminated by `type`. Mirrors the Swift
|
|
6
|
+
* `RKWindowPresence` enum.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* The `present` member ({@link WindowInfo}) carries the window's position,
|
|
10
|
+
* size and identifying metadata at that moment; the `absent` member
|
|
11
|
+
* ({@link WindowAbsence}) marks a time at which the tracked window was not
|
|
12
|
+
* present (e.g. closed, minimized, or moved to another Space).
|
|
13
|
+
*
|
|
14
|
+
* @group Recording
|
|
15
|
+
*/
|
|
16
|
+
export type WindowPresence = WindowInfo | WindowAbsence;
|
|
17
|
+
/**
|
|
18
|
+
* Information about a window that is present at a point in time within a recording.
|
|
19
|
+
*
|
|
20
|
+
* Mirrors the Swift `RKWindowInfo` struct (the `present` case of
|
|
21
|
+
* `RKWindowPresence`).
|
|
22
|
+
*
|
|
23
|
+
* @group Recording
|
|
24
|
+
*/
|
|
25
|
+
export interface WindowInfo {
|
|
26
|
+
type: 'present';
|
|
27
|
+
/** Time the event occurred in the recording. */
|
|
28
|
+
time: EventTime;
|
|
29
|
+
/** ID of the window. */
|
|
30
|
+
windowID: number;
|
|
31
|
+
/** Title of the window. */
|
|
32
|
+
windowTitle?: string;
|
|
33
|
+
/**
|
|
34
|
+
* ID of the macOS Space where this window lives (can be used to detect space changes).
|
|
35
|
+
*
|
|
36
|
+
* @remarks Mirrors a Swift `UInt64`; for very large Space IDs this can exceed JavaScript's
|
|
37
|
+
* `Number.MAX_SAFE_INTEGER`. ({@link WindowInfo.windowID} and {@link WindowInfo.applicationID}
|
|
38
|
+
* are 32-bit and not affected.)
|
|
39
|
+
*/
|
|
40
|
+
spaceID?: number;
|
|
41
|
+
/** ID of the application the window belongs to. */
|
|
42
|
+
applicationID?: number;
|
|
43
|
+
/** Title of the application the window belongs to. */
|
|
44
|
+
applicationName?: string;
|
|
45
|
+
/** X-axis position of the window relative to the top left of recorded area, ranging from 0 to 1. */
|
|
46
|
+
x: number;
|
|
47
|
+
/** Y-axis position of the window relative to the top left of recorded area, ranging from 0 to 1. */
|
|
48
|
+
y: number;
|
|
49
|
+
/** Width of the window relative to the top left of recorded area, ranging from 0 to 1. */
|
|
50
|
+
width: number;
|
|
51
|
+
/** Height of the window relative to the top left of recorded area, ranging from 0 to 1. */
|
|
52
|
+
height: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Marks the absence of a window at a point in time within a recording.
|
|
56
|
+
*
|
|
57
|
+
* Mirrors the Swift `RKWindowAbsence` struct (the `absent` case of
|
|
58
|
+
* `RKWindowPresence`).
|
|
59
|
+
*
|
|
60
|
+
* @group Recording
|
|
61
|
+
*/
|
|
62
|
+
export interface WindowAbsence {
|
|
63
|
+
type: 'absent';
|
|
64
|
+
/** Time the event occurred in the recording. */
|
|
65
|
+
time: EventTime;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* An event representing a video dimension change during recording.
|
|
69
|
+
* This can be caused by device rotation or other content size changes.
|
|
70
|
+
*
|
|
71
|
+
* Mirrors the Swift `RKVideoDimensionChange` struct.
|
|
72
|
+
*
|
|
73
|
+
* @group Recording
|
|
74
|
+
*/
|
|
75
|
+
export interface VideoDimensionChange {
|
|
76
|
+
/** Time the dimension change occurred in the recording. */
|
|
77
|
+
time: EventTime;
|
|
78
|
+
/** The original (pre-rotation) dimensions of the content, in pixels. */
|
|
79
|
+
dimensions: {
|
|
80
|
+
/** Content width in pixels. */
|
|
81
|
+
width: number;
|
|
82
|
+
/** Content height in pixels. */
|
|
83
|
+
height: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* The rotation in degrees (0, 90, 180, or -90) that a player should apply to display
|
|
87
|
+
* this segment correctly. Positive values are clockwise, negative are counterclockwise.
|
|
88
|
+
*/
|
|
89
|
+
rotation: number;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the player should animate the transition to this rotation.
|
|
92
|
+
* `true` when device rotated during continuous recording.
|
|
93
|
+
* `false` at recording start or after pause/resume (instant change).
|
|
94
|
+
*/
|
|
95
|
+
animated: boolean;
|
|
96
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// TypeScript mirrors of the Swift `Codable` types whose JSON is written to sidecar files inside a
|
|
2
|
+
// RecordKit recording bundle. Consumers parse those JSON files and rely on these types to describe
|
|
3
|
+
// their shape: property names are verbatim camelCase, Swift optionals become optional properties,
|
|
4
|
+
// and Swift tagged-union enums encode as flat objects discriminated by a `type` field at the same
|
|
5
|
+
// level as the payload.
|
|
6
|
+
//
|
|
7
|
+
// Keep this file in sync with the corresponding Swift sources:
|
|
8
|
+
// - `RKWindowPresence.swift`
|
|
9
|
+
// - `RKVideoDimensionChange.swift`
|
|
10
|
+
// (The `RKBundleInfo` mirror, `BundleInfo`, lives in `Recorder.ts`.)
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=RecordingMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordingMetadata.js","sourceRoot":"","sources":["../src/RecordingMetadata.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,kGAAkG;AAClG,wBAAwB;AACxB,EAAE;AACF,+DAA+D;AAC/D,6BAA6B;AAC7B,mCAAmC;AACnC,qEAAqE"}
|
package/out/WebAudioUtils.d.ts
CHANGED
|
@@ -29,3 +29,38 @@ import { AudioStreamBuffer } from './Recorder.js';
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export declare function createWebAudioBuffer(audioStreamBuffer: AudioStreamBuffer, audioContext: AudioContext): AudioBuffer | null;
|
|
32
|
+
/**
|
|
33
|
+
* An audio level measurement, as returned by {@link computeAudioLevel}.
|
|
34
|
+
*
|
|
35
|
+
* @group Recording
|
|
36
|
+
*/
|
|
37
|
+
export interface AudioLevel {
|
|
38
|
+
/** Root-mean-square (average) amplitude across all channels. Usually in `[0, 1]`, but can exceed `1` for hot or clipped signals. */
|
|
39
|
+
rms: number;
|
|
40
|
+
/** Peak absolute amplitude across all channels. Usually in `[0, 1]`, but can exceed `1` for hot or clipped signals. */
|
|
41
|
+
peak: number;
|
|
42
|
+
/** {@link AudioLevel.rms} in decibels relative to full scale (0 dBFS). `-Infinity` for silence; can exceed `0` for clipped signals. */
|
|
43
|
+
rmsDb: number;
|
|
44
|
+
/** {@link AudioLevel.peak} in decibels relative to full scale (0 dBFS). `-Infinity` for silence; can exceed `0` for clipped signals. */
|
|
45
|
+
peakDb: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Computes RMS and peak audio levels from an {@link AudioStreamBuffer}, for rendering a microphone (or
|
|
49
|
+
* system-audio) level meter.
|
|
50
|
+
*
|
|
51
|
+
* Electron has no dedicated microphone-preview component; the supported way to render a live level meter
|
|
52
|
+
* is to use a microphone/system-audio `stream` output and call this helper in your `streamCallback`.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { computeAudioLevel } from '@nonstrict/recordkit';
|
|
57
|
+
*
|
|
58
|
+
* const streamCallback = (audioBuffer) => {
|
|
59
|
+
* const { peakDb } = computeAudioLevel(audioBuffer);
|
|
60
|
+
* meterElement.style.height = `${Math.max(0, 100 + peakDb)}%`; // -100 dB..0 dB -> 0%..100%
|
|
61
|
+
* };
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @group Recording
|
|
65
|
+
*/
|
|
66
|
+
export declare function computeAudioLevel(audioStreamBuffer: AudioStreamBuffer): AudioLevel;
|
package/out/WebAudioUtils.js
CHANGED
|
@@ -92,4 +92,41 @@ export function createWebAudioBuffer(audioStreamBuffer, audioContext) {
|
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Computes RMS and peak audio levels from an {@link AudioStreamBuffer}, for rendering a microphone (or
|
|
97
|
+
* system-audio) level meter.
|
|
98
|
+
*
|
|
99
|
+
* Electron has no dedicated microphone-preview component; the supported way to render a live level meter
|
|
100
|
+
* is to use a microphone/system-audio `stream` output and call this helper in your `streamCallback`.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* import { computeAudioLevel } from '@nonstrict/recordkit';
|
|
105
|
+
*
|
|
106
|
+
* const streamCallback = (audioBuffer) => {
|
|
107
|
+
* const { peakDb } = computeAudioLevel(audioBuffer);
|
|
108
|
+
* meterElement.style.height = `${Math.max(0, 100 + peakDb)}%`; // -100 dB..0 dB -> 0%..100%
|
|
109
|
+
* };
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @group Recording
|
|
113
|
+
*/
|
|
114
|
+
export function computeAudioLevel(audioStreamBuffer) {
|
|
115
|
+
let sumSquares = 0;
|
|
116
|
+
let peak = 0;
|
|
117
|
+
let count = 0;
|
|
118
|
+
for (const channel of audioStreamBuffer.channelData) {
|
|
119
|
+
for (let i = 0; i < channel.length; i++) {
|
|
120
|
+
const sample = channel[i];
|
|
121
|
+
sumSquares += sample * sample;
|
|
122
|
+
const abs = Math.abs(sample);
|
|
123
|
+
if (abs > peak)
|
|
124
|
+
peak = abs;
|
|
125
|
+
count++;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const rms = count > 0 ? Math.sqrt(sumSquares / count) : 0;
|
|
129
|
+
const toDb = (value) => value > 0 ? 20 * Math.log10(value) : -Infinity;
|
|
130
|
+
return { rms, peak, rmsDb: toDb(rms), peakDb: toDb(peak) };
|
|
131
|
+
}
|
|
95
132
|
//# sourceMappingURL=WebAudioUtils.js.map
|
package/out/WebAudioUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebAudioUtils.js","sourceRoot":"","sources":["../src/WebAudioUtils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,oBAAoB,CAClC,iBAAoC,EACpC,YAA0B;IAE1B,mBAAmB;IACnB,IAAI,CAAC,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,YAAY,IAAI,OAAO,YAAY,CAAC,YAAY,KAAK,U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2
|
+
* Named macOS window levels, mirroring RecordKit's `RKWindow.Level` Swift type.
|
|
3
|
+
*
|
|
4
|
+
* A {@link Window}'s `level` is a raw integer. macOS assigns windows to a small set of well-known
|
|
5
|
+
* levels; this map lets you compare a window's level against those named values, e.g.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* if (window.level === WINDOW_LEVELS.floating) { ... }
|
|
9
|
+
* if (window.level >= WINDOW_LEVELS.mainMenu) { ... } // at or above the menu bar
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Levels are `Comparable` in Swift: a higher number is drawn in front of a lower one. Some names
|
|
13
|
+
* share the same numeric value (e.g. `floating`, `submenu`, `tornOffMenu` are all `3`).
|
|
14
|
+
*
|
|
15
|
+
* @group Discovery
|
|
16
|
+
*/
|
|
17
|
+
export declare const WINDOW_LEVELS: {
|
|
18
|
+
readonly baseWindow: -2147483648;
|
|
19
|
+
readonly minimumWindow: -2147483643;
|
|
20
|
+
readonly desktopWindow: -2147483623;
|
|
21
|
+
readonly desktopIconWindow: -2147483603;
|
|
22
|
+
readonly backstopMenu: -20;
|
|
23
|
+
readonly normal: 0;
|
|
24
|
+
readonly floating: 3;
|
|
25
|
+
readonly submenu: 3;
|
|
26
|
+
readonly tornOffMenu: 3;
|
|
27
|
+
readonly modalPanel: 8;
|
|
28
|
+
readonly utilityWindow: 19;
|
|
29
|
+
readonly mainMenu: 24;
|
|
30
|
+
readonly statusBar: 25;
|
|
31
|
+
readonly popUpMenu: 101;
|
|
32
|
+
readonly overlayWindow: 102;
|
|
33
|
+
readonly helpWindow: 200;
|
|
34
|
+
readonly draggingWindow: 500;
|
|
35
|
+
readonly screenSaver: 1000;
|
|
36
|
+
readonly screenSaverWindow: 1000;
|
|
37
|
+
readonly assistiveTechHighWindow: 1500;
|
|
38
|
+
readonly cursorWindow: 2147483630;
|
|
39
|
+
readonly maximumWindow: 2147483631;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The name of a well-known macOS window level. See {@link WINDOW_LEVELS}.
|
|
43
|
+
*
|
|
44
|
+
* @group Discovery
|
|
45
|
+
*/
|
|
46
|
+
export type WindowLevelName = keyof typeof WINDOW_LEVELS;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named macOS window levels, mirroring RecordKit's `RKWindow.Level` Swift type.
|
|
3
|
+
*
|
|
4
|
+
* A {@link Window}'s `level` is a raw integer. macOS assigns windows to a small set of well-known
|
|
5
|
+
* levels; this map lets you compare a window's level against those named values, e.g.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* if (window.level === WINDOW_LEVELS.floating) { ... }
|
|
9
|
+
* if (window.level >= WINDOW_LEVELS.mainMenu) { ... } // at or above the menu bar
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Levels are `Comparable` in Swift: a higher number is drawn in front of a lower one. Some names
|
|
13
|
+
* share the same numeric value (e.g. `floating`, `submenu`, `tornOffMenu` are all `3`).
|
|
14
|
+
*
|
|
15
|
+
* @group Discovery
|
|
16
|
+
*/
|
|
17
|
+
export const WINDOW_LEVELS = {
|
|
18
|
+
baseWindow: -2147483648,
|
|
19
|
+
minimumWindow: -2147483643,
|
|
20
|
+
desktopWindow: -2147483623,
|
|
21
|
+
desktopIconWindow: -2147483603,
|
|
22
|
+
backstopMenu: -20,
|
|
23
|
+
normal: 0,
|
|
24
|
+
floating: 3,
|
|
25
|
+
submenu: 3,
|
|
26
|
+
tornOffMenu: 3,
|
|
27
|
+
modalPanel: 8,
|
|
28
|
+
utilityWindow: 19,
|
|
29
|
+
mainMenu: 24,
|
|
30
|
+
statusBar: 25,
|
|
31
|
+
popUpMenu: 101,
|
|
32
|
+
overlayWindow: 102,
|
|
33
|
+
helpWindow: 200,
|
|
34
|
+
draggingWindow: 500,
|
|
35
|
+
screenSaver: 1000,
|
|
36
|
+
screenSaverWindow: 1000,
|
|
37
|
+
assistiveTechHighWindow: 1500,
|
|
38
|
+
cursorWindow: 2147483630,
|
|
39
|
+
maximumWindow: 2147483631,
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=WindowLevels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WindowLevels.js","sourceRoot":"","sources":["../src/WindowLevels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,UAAU,EAAE,CAAC,UAAU;IACvB,aAAa,EAAE,CAAC,UAAU;IAC1B,aAAa,EAAE,CAAC,UAAU;IAC1B,iBAAiB,EAAE,CAAC,UAAU;IAC9B,YAAY,EAAE,CAAC,EAAE;IACjB,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,aAAa,EAAE,EAAE;IACjB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,GAAG;IAClB,UAAU,EAAE,GAAG;IACf,cAAc,EAAE,GAAG;IACnB,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,IAAI;IACvB,uBAAuB,EAAE,IAAI;IAC7B,YAAY,EAAE,UAAU;IACxB,aAAa,EAAE,UAAU;CACjB,CAAC"}
|
package/out/browser.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
export { createWebAudioBuffer } from './WebAudioUtils.js';
|
|
1
|
+
export { createWebAudioBuffer, computeAudioLevel } from './WebAudioUtils.js';
|
|
2
2
|
export type { AudioStreamBuffer } from './Recorder.js';
|
|
3
|
+
export type { AudioLevel } from './WebAudioUtils.js';
|
|
4
|
+
export type * from './InputEvents.js';
|
|
5
|
+
export type * from './RecordingMetadata.js';
|
|
6
|
+
export type * from './Errors.js';
|
|
7
|
+
export type * from './WindowLevels.js';
|
|
8
|
+
export { RECORDKIT_ERROR_CODE_NUMBERS } from './Errors.js';
|
|
9
|
+
export { WINDOW_LEVELS } from './WindowLevels.js';
|
package/out/browser.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// Browser-only exports - safe for use in browser environments
|
|
2
2
|
// This entry point excludes Node.js-specific functionality like EventEmitter, crypto, etc.
|
|
3
|
-
export { createWebAudioBuffer } from './WebAudioUtils.js';
|
|
3
|
+
export { createWebAudioBuffer, computeAudioLevel } from './WebAudioUtils.js';
|
|
4
|
+
export { RECORDKIT_ERROR_CODE_NUMBERS } from './Errors.js';
|
|
5
|
+
export { WINDOW_LEVELS } from './WindowLevels.js';
|
|
4
6
|
//# sourceMappingURL=browser.js.map
|
package/out/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,2FAA2F;AAE3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,2FAA2F;AAE3F,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAY7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|