@camstack/addon-pipeline 1.2.219 → 1.2.221
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/audio-analyzer/index.js +661 -7
- package/dist/audio-analyzer/index.mjs +658 -5
- package/dist/chunk-emK7D4bc.js +35 -0
- package/dist/{default-detection-model-d7-Q_LMo.js → default-detection-model-B1NT1A38.js} +1 -1
- package/dist/{default-detection-model-Dsk1a5pY.mjs → default-detection-model-DkVFgubU.mjs} +1 -1
- package/dist/detection-pipeline/index.js +10 -9
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-wtNhtVVo.js → dist-ATDfcxgL.js} +282 -39
- package/dist/{dist-CKK0CBUW.mjs → dist-CEFC3PkP.mjs} +265 -5
- package/dist/{lazy-sharp-zoQ07I43.js → lazy-sharp-BuwKlQLR.js} +2 -2
- package/dist/motion-wasm/index.js +2 -2
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-BduNi21Z.js → node-C5jnTgpv.js} +4 -3
- package/dist/{node-CrNBWFbA.mjs → node-DR3fHqUq.mjs} +1 -1
- package/dist/pipeline-runner/index.js +222 -157
- package/dist/pipeline-runner/index.mjs +218 -154
- package/dist/{process-memory-Dwl0MFPH.js → process-memory-DQbCPnMA.js} +3 -2
- package/dist/{process-memory-BRQOtDN1.mjs → process-memory-DqYj5IAb.mjs} +1 -1
- package/dist/recorder/index.js +344 -127
- package/dist/recorder/index.mjs +342 -126
- package/dist/{segment-demux-js-D2o9ShNL.mjs → segment-demux-js-CddDwD69.mjs} +1 -1
- package/dist/{segment-demux-js-CFOU3biG.js → segment-demux-js-o9KBAz9p.js} +4 -3
- package/dist/session-decode/decode-worker-child.js +155 -74
- package/dist/session-decode/decode-worker-child.mjs +154 -73
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DN_IoShh.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-D5XnLZWR.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CyMYDKfM.mjs +26 -0
- package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DICVQkNi.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CKUGpDns.mjs} +1 -1
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-n7c9pNlt.mjs → hostInit-C-VdcJS2.mjs} +3 -3
- package/dist/stream-broker/index.js +231 -112
- package/dist/stream-broker/index.mjs +224 -106
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/dist/worker-protocol-B2MfQLlu.js +184 -0
- package/dist/worker-protocol-C_W-P_g-.mjs +161 -0
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-7hqrrd88.mjs +0 -26
- package/dist/worker-protocol-Cx3Nqreq.mjs +0 -264
- package/dist/worker-protocol-iWTFnnUM.js +0 -299
|
@@ -5345,6 +5345,118 @@ var ZodIssueCode = {
|
|
|
5345
5345
|
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5346
5346
|
var ZodFirstPartyTypeKind;
|
|
5347
5347
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5348
|
+
//#endregion
|
|
5349
|
+
//#region ../types/dist/sleep-BnujYGPe.mjs
|
|
5350
|
+
/**
|
|
5351
|
+
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5352
|
+
* window to float samples (D455).
|
|
5353
|
+
*
|
|
5354
|
+
* ## Why a format at all
|
|
5355
|
+
*
|
|
5356
|
+
* D450 took the plane off its 8 → 16 kHz upsample: it carries the SOURCE
|
|
5357
|
+
* RATE, and the one consumer that needs 16 kHz resamples next to the model.
|
|
5358
|
+
* It left the FORMAT alone — the broker still turned each G.711 byte into a
|
|
5359
|
+
* 4-byte f32le sample before the bytes entered the transport, so every leg of
|
|
5360
|
+
* the plane carried four times the source. The plane crosses hub-main twice on
|
|
5361
|
+
* the way to the analyzer, and the fleet's G.711 cameras are ~79 % of it.
|
|
5362
|
+
*
|
|
5363
|
+
* So the plane carries the source BYTES too, and whoever needs floats expands
|
|
5364
|
+
* them where it needs them. That is the same argument D450 made for the rate,
|
|
5365
|
+
* one step further along the same wire.
|
|
5366
|
+
*
|
|
5367
|
+
* ## Why the expansion lives here
|
|
5368
|
+
*
|
|
5369
|
+
* Two packages need it and they must never disagree: `addon-pipeline`'s broker
|
|
5370
|
+
* (which still has to serve a subscriber that did NOT ask for coded bytes —
|
|
5371
|
+
* `AudioChunkPlane` expands per subscription) and
|
|
5372
|
+
* `addon-pipeline-orchestrator`'s `AudioWindowAccumulator` (which flushes an
|
|
5373
|
+
* f32le window to the analyzer cap, whose `AudioChunkInput` contract is
|
|
5374
|
+
* unchanged and stays f32le). Both bundle the bare `@camstack/types` entry
|
|
5375
|
+
* into their own dist (`self-contained` externals), so this travels with a
|
|
5376
|
+
* `camstack deploy` and needs no published server.
|
|
5377
|
+
*
|
|
5378
|
+
* A second μ-law table anywhere else is the defect this module exists to
|
|
5379
|
+
* prevent. (`stream-broker.ts`'s `mulawToPcm` / `alawToPcm` are the ENCODE
|
|
5380
|
+
* direction for the WebRTC egress — a different transform, not a copy.)
|
|
5381
|
+
*
|
|
5382
|
+
* ## Absent means f32le
|
|
5383
|
+
*
|
|
5384
|
+
* `format` is optional on the wire and its absence means `f32le` — today's
|
|
5385
|
+
* bytes, byte for byte. A peer that never heard of the field is served what it
|
|
5386
|
+
* has always been served, because the broker only emits a coded window to a
|
|
5387
|
+
* subscription that DECLARED it accepts one (`AudioSubscribeOptions.accept`).
|
|
5388
|
+
* That is the D448 `rawForward` negotiation, and it is what makes this
|
|
5389
|
+
* deployable one addon at a time across three nodes.
|
|
5390
|
+
*/
|
|
5391
|
+
/** Every byte format the audio chunk plane can carry. `f32le` is the default. */
|
|
5392
|
+
var AUDIO_CHUNK_FORMATS = [
|
|
5393
|
+
"f32le",
|
|
5394
|
+
"pcmu",
|
|
5395
|
+
"pcma"
|
|
5396
|
+
];
|
|
5397
|
+
/**
|
|
5398
|
+
* Bytes one sample of `format` occupies. This is the number every duration
|
|
5399
|
+
* calculation over a chunk's `data` must use — a window accumulator that
|
|
5400
|
+
* hard-codes 4 reports a quarter of the audio it actually holds and flushes
|
|
5401
|
+
* four-second windows to a classifier expecting one.
|
|
5402
|
+
*/
|
|
5403
|
+
function audioChunkBytesPerSample(format) {
|
|
5404
|
+
return format === "f32le" ? 4 : 1;
|
|
5405
|
+
}
|
|
5406
|
+
/**
|
|
5407
|
+
* Expand a CODED audio window to freshly-owned f32le bytes, 4-byte aligned at
|
|
5408
|
+
* offset 0, so a caller can build a `Float32Array` view over them directly.
|
|
5409
|
+
* The input may be a msgpack subview at any offset; nothing here reads it as
|
|
5410
|
+
* anything but bytes.
|
|
5411
|
+
*
|
|
5412
|
+
* `f32le` is accepted and returns a copy, but a caller that already knows the
|
|
5413
|
+
* format is `f32le` should not call this at all — it has the bytes. Both
|
|
5414
|
+
* callers branch on the format first for exactly that reason, and the copy
|
|
5415
|
+
* here exists so the return type is always owned rather than sometimes
|
|
5416
|
+
* aliasing the argument.
|
|
5417
|
+
*/
|
|
5418
|
+
function expandAudioChunkToF32le(data, format) {
|
|
5419
|
+
if (format === "f32le") {
|
|
5420
|
+
const copy = new Uint8Array(data.byteLength);
|
|
5421
|
+
copy.set(data);
|
|
5422
|
+
return copy;
|
|
5423
|
+
}
|
|
5424
|
+
const table = format === "pcmu" ? ULAW_TABLE : ALAW_TABLE;
|
|
5425
|
+
const out = new Float32Array(data.length);
|
|
5426
|
+
for (let i = 0; i < data.length; i++) out[i] = table[data[i]];
|
|
5427
|
+
return new Uint8Array(out.buffer);
|
|
5428
|
+
}
|
|
5429
|
+
/**
|
|
5430
|
+
* Build the μ-law decode table (ITU-T G.711). Each of the 256 byte values maps
|
|
5431
|
+
* to a 16-bit PCM sample, normalised to [-1.0, 1.0] for f32le output.
|
|
5432
|
+
*
|
|
5433
|
+
* Moved here verbatim from `audio-rtp-decoder.ts`, which no longer decodes:
|
|
5434
|
+
* it buffers the coded bytes and the plane's consumers expand.
|
|
5435
|
+
*/
|
|
5436
|
+
function buildUlawTable() {
|
|
5437
|
+
const table = new Float32Array(256);
|
|
5438
|
+
for (let i = 0; i < 256; i++) {
|
|
5439
|
+
const complemented = ~i & 255;
|
|
5440
|
+
const sign = (complemented & 128) !== 0 ? -1 : 1;
|
|
5441
|
+
const exponent = complemented >> 4 & 7;
|
|
5442
|
+
table[i] = sign * ((8 * (complemented & 15) + 132 << exponent) - 132) / 32768;
|
|
5443
|
+
}
|
|
5444
|
+
return table;
|
|
5445
|
+
}
|
|
5446
|
+
/** Build the A-law decode table (ITU-T G.711). */
|
|
5447
|
+
function buildAlawTable() {
|
|
5448
|
+
const table = new Float32Array(256);
|
|
5449
|
+
for (let i = 0; i < 256; i++) {
|
|
5450
|
+
const xored = i ^ 85;
|
|
5451
|
+
const sign = (xored & 128) !== 0 ? 1 : -1;
|
|
5452
|
+
const exponent = xored >> 4 & 7;
|
|
5453
|
+
const mantissa = xored & 15;
|
|
5454
|
+
table[i] = sign * (exponent === 0 ? 16 * mantissa + 8 : 16 * mantissa + 264 << exponent - 1) / 32768;
|
|
5455
|
+
}
|
|
5456
|
+
return table;
|
|
5457
|
+
}
|
|
5458
|
+
var ULAW_TABLE = buildUlawTable();
|
|
5459
|
+
var ALAW_TABLE = buildAlawTable();
|
|
5348
5460
|
Object.fromEntries([
|
|
5349
5461
|
{
|
|
5350
5462
|
id: "overview",
|
|
@@ -6717,11 +6829,20 @@ var SubscribeFramesResultSchema = object({
|
|
|
6717
6829
|
* (the wire-serialisable supertype of `Buffer`) to match `DecodedFrameSchema`
|
|
6718
6830
|
* / `EncodedPacketSchema`'s precedent; a `Buffer` is assignable to it.
|
|
6719
6831
|
*/
|
|
6832
|
+
var AudioChunkFormatSchema = _enum(AUDIO_CHUNK_FORMATS);
|
|
6720
6833
|
var DecodedAudioChunkSchema = object({
|
|
6721
6834
|
data: _instanceof(Uint8Array),
|
|
6722
6835
|
sampleRate: number().int().positive(),
|
|
6723
6836
|
channels: number().int().positive(),
|
|
6724
|
-
timestamp: number()
|
|
6837
|
+
timestamp: number(),
|
|
6838
|
+
/**
|
|
6839
|
+
* Byte format of `data`. ABSENT MEANS `f32le` — today's bytes, byte for
|
|
6840
|
+
* byte, for any peer that never heard of this field. A coded window
|
|
6841
|
+
* (`pcmu` / `pcma`, one byte per sample) is only ever emitted to a
|
|
6842
|
+
* subscription that DECLARED it accepts one, so absence can never mean
|
|
6843
|
+
* "coded bytes a consumer will read as floats" (D455).
|
|
6844
|
+
*/
|
|
6845
|
+
format: AudioChunkFormatSchema.optional()
|
|
6725
6846
|
});
|
|
6726
6847
|
/**
|
|
6727
6848
|
* Input for `stream-broker.subscribeAudioChunks` (Phase 5 / D9). The
|
|
@@ -6733,7 +6854,18 @@ var DecodedAudioChunkSchema = object({
|
|
|
6733
6854
|
var SubscribeAudioChunksInputSchema = object({
|
|
6734
6855
|
brokerId: string(),
|
|
6735
6856
|
/** Short caller-identity tag (`audio-analyzer`, …) for `listClients`. */
|
|
6736
|
-
tag: string().optional()
|
|
6857
|
+
tag: string().optional(),
|
|
6858
|
+
/**
|
|
6859
|
+
* Byte formats this subscriber can READ, best first. The broker serves the
|
|
6860
|
+
* chunk's own format when it is in this list and expands to `f32le`
|
|
6861
|
+
* otherwise, so a subscriber is never handed bytes it cannot interpret.
|
|
6862
|
+
*
|
|
6863
|
+
* Absent (or without the source format) means `f32le` — the behaviour every
|
|
6864
|
+
* subscriber had before D455, unchanged. This is the negotiation half of
|
|
6865
|
+
* the source-bytes lever: it is what lets the broker and its consumers
|
|
6866
|
+
* deploy one at a time across three nodes.
|
|
6867
|
+
*/
|
|
6868
|
+
accept: array(AudioChunkFormatSchema).readonly().optional()
|
|
6737
6869
|
});
|
|
6738
6870
|
/** Result of `stream-broker.subscribeAudioChunks`. */
|
|
6739
6871
|
var SubscribeAudioChunksResultSchema = object({
|
|
@@ -12340,6 +12472,51 @@ var AudioAnalysisSettingsSchema = object({
|
|
|
12340
12472
|
minConfidence: number().min(0).max(1).default(.3),
|
|
12341
12473
|
allowedClasses: array(string()).default([])
|
|
12342
12474
|
});
|
|
12475
|
+
/**
|
|
12476
|
+
* `attachDevice` — the analyzer PULLS a camera's audio from the broker (D461).
|
|
12477
|
+
*
|
|
12478
|
+
* Until D461 the orchestrator drained the broker's chunk plane, accumulated
|
|
12479
|
+
* ~1 s windows and pushed them back out as `analyseChunk`. It neither produced
|
|
12480
|
+
* nor consumed the audio: the PCM crossed hub-main twice for a process that
|
|
12481
|
+
* only buffered it. `attachDevice` inverts the direction — the analyzer opens
|
|
12482
|
+
* its own `subscribeAudioChunks` against the broker and the subscriber IS the
|
|
12483
|
+
* decoder, so the coded G.711 bytes D455 put on the plane stay coded all the
|
|
12484
|
+
* way to the one expansion that feeds the model.
|
|
12485
|
+
*
|
|
12486
|
+
* The orchestrator still owns the POLICY (the `audioMode` gate, the on-motion
|
|
12487
|
+
* window, the per-device node assignment, the settings read) and therefore
|
|
12488
|
+
* still owns the attach/detach pair. It no longer owns the bytes.
|
|
12489
|
+
*/
|
|
12490
|
+
var AudioAttachDeviceInputSchema = object({
|
|
12491
|
+
deviceId: number(),
|
|
12492
|
+
/** Broker id (`<deviceId>/<camStreamId>`) carrying this camera's audio. */
|
|
12493
|
+
brokerId: string(),
|
|
12494
|
+
/**
|
|
12495
|
+
* `clusterRoles.ingestNode` — the node whose broker owns the source dial.
|
|
12496
|
+
* Every `streamBroker` call the attachment makes is pinned to it, exactly as
|
|
12497
|
+
* the orchestrator's poller pinned them before the move.
|
|
12498
|
+
*/
|
|
12499
|
+
ingestNodeId: string(),
|
|
12500
|
+
/**
|
|
12501
|
+
* Resolved once by the orchestrator at attach time, exactly as it was read
|
|
12502
|
+
* once per subscription before D461. The analyzer does NOT re-resolve per
|
|
12503
|
+
* window: a settings change re-attaches, which is what always happened.
|
|
12504
|
+
*/
|
|
12505
|
+
settings: AudioAnalysisSettingsSchema
|
|
12506
|
+
});
|
|
12507
|
+
var AudioAttachDeviceResultSchema = object({
|
|
12508
|
+
/** False only when the analyzer is shutting down and refused to attach. */
|
|
12509
|
+
attached: boolean(),
|
|
12510
|
+
/**
|
|
12511
|
+
* True when the attachment replaced a live one for the same device. An
|
|
12512
|
+
* attach is idempotent by REPLACEMENT — two pollers on one camera would
|
|
12513
|
+
* double the broker's fanout and neither would know about the other.
|
|
12514
|
+
*/
|
|
12515
|
+
replaced: boolean()
|
|
12516
|
+
});
|
|
12517
|
+
var AudioDetachDeviceResultSchema = object({
|
|
12518
|
+
/** False when no attachment existed — detach is idempotent. */
|
|
12519
|
+
detached: boolean() });
|
|
12343
12520
|
var AudioClassificationResultSchema = object({
|
|
12344
12521
|
labels: array(AudioClassificationLabelSchema).readonly(),
|
|
12345
12522
|
rawLabels: array(AudioClassificationLabelSchema).readonly().optional(),
|
|
@@ -12388,6 +12565,21 @@ var audioAnalyzerCapability = {
|
|
|
12388
12565
|
settings: AudioAnalysisSettingsSchema
|
|
12389
12566
|
}), AudioAnalysisResultSchema.nullable(), { kind: "mutation" }),
|
|
12390
12567
|
classify: method(AudioChunkInputSchema, AudioClassificationResultSchema, { timeoutMs: 3e4 }),
|
|
12568
|
+
/**
|
|
12569
|
+
* Start pulling this camera's audio from the broker, in THIS process.
|
|
12570
|
+
* Returns as soon as the attachment exists — the first
|
|
12571
|
+
* `subscribeAudioChunks` retries with backoff behind it, because the
|
|
12572
|
+
* broker for a camStream may not be registered yet (that tolerance moved
|
|
12573
|
+
* with the poller, D461). Replaces any live attachment for the device.
|
|
12574
|
+
*/
|
|
12575
|
+
attachDevice: method(AudioAttachDeviceInputSchema, AudioAttachDeviceResultSchema, { kind: "mutation" }),
|
|
12576
|
+
/**
|
|
12577
|
+
* Stop pulling this camera's audio and release the broker subscription.
|
|
12578
|
+
* Idempotent. A detach that never arrives is the one failure mode this
|
|
12579
|
+
* split adds, which is why `AudioChunkPlane` reaps a subscription nobody
|
|
12580
|
+
* drains rather than trusting it (D461).
|
|
12581
|
+
*/
|
|
12582
|
+
detachDevice: method(object({ deviceId: number() }), AudioDetachDeviceResultSchema, { kind: "mutation" }),
|
|
12391
12583
|
isReady: method(_void(), boolean()),
|
|
12392
12584
|
dispose: method(_void(), _void(), { kind: "mutation" }),
|
|
12393
12585
|
/**
|
|
@@ -27854,8 +28046,8 @@ includeCrops: boolean().optional() }).optional(), array(IdentitySchema).readonly
|
|
|
27854
28046
|
*
|
|
27855
28047
|
* An **empty array reads NOTHING** — `[]` is an empty page, never
|
|
27856
28048
|
* "every camera". A request for no devices is a request, not an
|
|
27857
|
-
* omission; same contract as `deviceManager.
|
|
27858
|
-
* `pipelineAnalytics.listRecentTracks`.
|
|
28049
|
+
* omission; same contract as `deviceManager.listAll`'s `deviceIds`
|
|
28050
|
+
* and `pipelineAnalytics.listRecentTracks`.
|
|
27859
28051
|
*
|
|
27860
28052
|
* Absent (`undefined`) is the omission, and keeps the cluster-wide view.
|
|
27861
28053
|
*/
|
|
@@ -34037,12 +34229,24 @@ Object.freeze({
|
|
|
34037
34229
|
addonId: null,
|
|
34038
34230
|
access: "create"
|
|
34039
34231
|
},
|
|
34232
|
+
"audioAnalyzer.attachDevice": {
|
|
34233
|
+
capName: "audio-analyzer",
|
|
34234
|
+
capScope: "system",
|
|
34235
|
+
addonId: null,
|
|
34236
|
+
access: "create"
|
|
34237
|
+
},
|
|
34040
34238
|
"audioAnalyzer.classify": {
|
|
34041
34239
|
capName: "audio-analyzer",
|
|
34042
34240
|
capScope: "system",
|
|
34043
34241
|
addonId: null,
|
|
34044
34242
|
access: "view"
|
|
34045
34243
|
},
|
|
34244
|
+
"audioAnalyzer.detachDevice": {
|
|
34245
|
+
capName: "audio-analyzer",
|
|
34246
|
+
capScope: "system",
|
|
34247
|
+
addonId: null,
|
|
34248
|
+
access: "create"
|
|
34249
|
+
},
|
|
34046
34250
|
"audioAnalyzer.dispose": {
|
|
34047
34251
|
capName: "audio-analyzer",
|
|
34048
34252
|
capScope: "system",
|
|
@@ -39886,11 +40090,21 @@ Object.freeze({
|
|
|
39886
40090
|
form: "single",
|
|
39887
40091
|
optional: false
|
|
39888
40092
|
}],
|
|
40093
|
+
"audioAnalyzer.attachDevice": [{
|
|
40094
|
+
name: "deviceId",
|
|
40095
|
+
form: "single",
|
|
40096
|
+
optional: false
|
|
40097
|
+
}],
|
|
39889
40098
|
"audioAnalyzer.classify": [{
|
|
39890
40099
|
name: "deviceId",
|
|
39891
40100
|
form: "single",
|
|
39892
40101
|
optional: true
|
|
39893
40102
|
}],
|
|
40103
|
+
"audioAnalyzer.detachDevice": [{
|
|
40104
|
+
name: "deviceId",
|
|
40105
|
+
form: "single",
|
|
40106
|
+
optional: false
|
|
40107
|
+
}],
|
|
39894
40108
|
"audioMetrics.getCurrentSnapshot": [{
|
|
39895
40109
|
name: "deviceId",
|
|
39896
40110
|
form: "single",
|
|
@@ -41742,6 +41956,51 @@ Object.freeze({
|
|
|
41742
41956
|
"network-access": "ingress",
|
|
41743
41957
|
"smtp-provider": "email"
|
|
41744
41958
|
});
|
|
41959
|
+
var G711_SCALE_CORRECTION_DB = {
|
|
41960
|
+
PCMU: 20 * Math.log10(4),
|
|
41961
|
+
PCMA: 20 * Math.log10(8)
|
|
41962
|
+
};
|
|
41963
|
+
/**
|
|
41964
|
+
* Restate a dBFS number that was MEASURED through the pre-epoch decoder as the
|
|
41965
|
+
* same intent on the ITU-T scale (D460).
|
|
41966
|
+
*
|
|
41967
|
+
* ## When this applies, and when it is the wrong thing to reach for
|
|
41968
|
+
*
|
|
41969
|
+
* An absolute-dBFS number in this repo is one of two things, and only one of
|
|
41970
|
+
* them converts:
|
|
41971
|
+
*
|
|
41972
|
+
* - **A statement about the scale** — "-55 dBFS is near silence", "-25 dBFS
|
|
41973
|
+
* is loud". It was true on the ITU-T scale before the epoch and it is true
|
|
41974
|
+
* after. The defect was never in the number; it was that 19 of this hub's
|
|
41975
|
+
* 25 cameras did not obey it. Converting such a number takes something
|
|
41976
|
+
* correct and makes it wrong, in order to preserve a bug.
|
|
41977
|
+
* - **A measurement taken through the old decoder** — a value someone read
|
|
41978
|
+
* off a meter that under-reported by exactly 4× (PCMU) or 8× (PCMA). It
|
|
41979
|
+
* describes a sound that was really {@link G711_SCALE_CORRECTION_DB} dB
|
|
41980
|
+
* louder. That is what this function is for.
|
|
41981
|
+
*
|
|
41982
|
+
* Telling the two apart is a question about PROVENANCE, not about arithmetic,
|
|
41983
|
+
* and it cannot be answered from the number. It is answered by the comment the
|
|
41984
|
+
* author left — which is why `scripts/check-dbfs-era.mts` makes leaving one
|
|
41985
|
+
* mandatory.
|
|
41986
|
+
*
|
|
41987
|
+
* ## Why a function and not a typed-in number
|
|
41988
|
+
*
|
|
41989
|
+
* `-55 + 12.04` written into a source file is, six months later, completely
|
|
41990
|
+
* indistinguishable from a threshold somebody simply preferred. Calling this
|
|
41991
|
+
* keeps the derivation, the law, and the original measurement all visible at
|
|
41992
|
+
* the call site, so a future reader can disagree with the *premise* instead of
|
|
41993
|
+
* having to reverse-engineer the sum.
|
|
41994
|
+
*
|
|
41995
|
+
* **This is not a runtime gain.** It converts an authored CONSTANT once, where
|
|
41996
|
+
* it is declared. It must never be applied to a live sample or a stored
|
|
41997
|
+
* `AudioEvent.dbfs`: the decoder is correct now, and a second authority
|
|
41998
|
+
* adjusting numbers the decoder already got right is the original defect with
|
|
41999
|
+
* an extra place to argue with (D459).
|
|
42000
|
+
*/
|
|
42001
|
+
function ituDbfsFromPreEpoch(law, authoredDbfs) {
|
|
42002
|
+
return authoredDbfs + G711_SCALE_CORRECTION_DB[law];
|
|
42003
|
+
}
|
|
41745
42004
|
/**
|
|
41746
42005
|
* audio-condition — the authoring logic behind the sustained-sound condition
|
|
41747
42006
|
* (`NcConditions.audio`), pure and UI-framework-free.
|
|
@@ -41792,6 +42051,7 @@ var AUDIO_KIND_PREFIX = "audio-";
|
|
|
41792
42051
|
function audioKindId(macroId) {
|
|
41793
42052
|
return macroId.startsWith(AUDIO_KIND_PREFIX) ? macroId : `${AUDIO_KIND_PREFIX}${macroId}`;
|
|
41794
42053
|
}
|
|
42054
|
+
Math.round(ituDbfsFromPreEpoch("PCMU", -55));
|
|
41795
42055
|
/** Schema defaults — an untouched sub-field must author exactly these. */
|
|
41796
42056
|
var NC_AUDIO_DEFAULTS = {
|
|
41797
42057
|
hitPercent: 60,
|
|
@@ -43325,4 +43585,4 @@ function enumerateInferenceDevices(hw) {
|
|
|
43325
43585
|
return out;
|
|
43326
43586
|
}
|
|
43327
43587
|
//#endregion
|
|
43328
|
-
export {
|
|
43588
|
+
export { evictionPolicyOfLocation as $, makeProfileBrokerId as $t, YAMNET_TO_MACRO as A, runtimeDevices as At, declareLogChannel as B, buildFfmpegArgs as Bt, PoolMemoryWatchdog as C, recordingExportCapability as Ct, RecordingConfigSchema as D, resolveLocationMode as Dt, RECORDING_EXPORT_MAX_READ_BYTES as E, resolveEgressDecodeHwAccel as Et, batteryCapability as F, supportedRuntimes as Ft, deriveRecordingMode as G, CAM_PROFILE_ORDER as Gt, defineCustomActions as H, isSoftwareDecode as Ht, cameraStreamsCapability as I, webrtcSessionCapability as It, egressTransportFromRequest as J, audioChunkBytesPerSample as Jt, detectionPipelineCapability as K, DeviceFeature as Kt, createHwAccelCache as L, errMsg as Lt, audioAnalysisCapability as M, storageOccupancyCapability as Mt, audioAnalyzerCapability as N, streamBrokerCapability as Nt, RecordingSignalStatusSchema as O, resolvePoolMemoryPolicy as Ot, audioKindId as P, stripRetiredBandPreBufferSec as Pt, evictionPolicyForMode as Q, isEvent as Qt, createLogChannelsProvider as R, AUDIO_PRESETS as Rt, OpsLogEntrySchema as S, recordingCapability as St, RATE_CONTROL_TIGHT as T, resolveClusterStepModelId as Tt, deriveBatteryPresence as U, BOOT_RECOVERY_BACKOFF_MS as Ut, defaultDeviceFor as V, invocationFromEncodeProfile as Vt, deriveDetailCropRect as W, BaseAddon as Wt, evaluateSensorEdge as X, expandAudioChunkToF32le as Xt, enumerateInferenceDevices as Y, createEvent as Yt, evaluateZoneRules as Z, hydrateSchema as Zt, FailureCounters as _, union as _n, pickClusterStepSettings as _t, COCO_80_LABELS as a, sleep as an, loadContributionCapability as at, NativeLeaseAdmissionSchema as b, pipelineExecutorCapability as bt, DEFAULT_CLUSTER_STEP_MODELS as c, boolean as cn, maskUrlCredentials as ct, DEFAULT_EVENTS_BAND_BUFFER_SEC as d, literal as dn, migrateLegacyDeviceSignalConfig as dt, makeSourceBrokerId as en, failureContributionCapability as et, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as f, number as fn, modeMayWrite as ft, ExportRecordSchema as g, string as gn, pickClusterStepModels as gt, EncodeProfileSchema as h, record as hn, parseProcStatus as ht, BatteryStatusSchema as i, selectAssignedProfileSlots as in, isFirstLevelMacroClass as it, addonWidgetsSourceCapability as j, storageEvictableCapability as jt, RingBuffer as k, resolveRecordingProfiles as kt, DEFAULT_CLUSTER_STEP_SETTINGS as l, discriminatedUnion as ln, mayReadLocation as lt, DEVICE_BACKEND_TO_FORMAT as m, preprocess as mn, overlayClusterStepSettings as mt, AUDIO_BACKEND_CHOICES as n, parseJsonUnknown as nn, hfModelUrl as nt, COCO_TO_MACRO as o, _enum as on, logChannelsCapability as ot, DEFAULT_NATIVE_LEASE_SETTINGS as p, object as pn, motionDetectionCapability as pt, egressTranscodeSharingKey as q, DeviceType as qt, AUDIO_MACRO_LABELS as r, parseProfileBrokerId as rn, inferModelProvider as rt, DEFAULT_AUDIO_ANALYZER_CONFIG as s, array as sn, mapAudioLabelToMacro as st, APPLE_SA_TO_MACRO as t, nodePin as tn, gbToBytes as tt, DEFAULT_DETAIL_CROP_CONVENTION as u, lazy as un, mayWriteToLocation as ut, G711_SCALE_CORRECTION_DB as v, EventCategory as vn, pickDetailCropConvention as vt, RATE_CONTROL_RELAXED as w, recordingSignalCapability as wt, NativeLeaseSettingsSchema as x, pipelineRunnerCapability as xt, HF_BASE_URL as y, pickNativeLeaseOverride as yt, customAction as z, Fmp4BoxSplitter as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
|
-
node_path =
|
|
3
|
+
node_path = require_chunk.__toESM(node_path);
|
|
4
4
|
let node_url = require("node:url");
|
|
5
5
|
let node_module = require("node:module");
|
|
6
6
|
//#region src/shared/host-external-import.ts
|
|
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
6
|
-
const require_lazy_sharp = require("../lazy-sharp-
|
|
5
|
+
const require_dist = require("../dist-ATDfcxgL.js");
|
|
6
|
+
const require_lazy_sharp = require("../lazy-sharp-BuwKlQLR.js");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
//#region src/motion-wasm/region-grouping.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Wt as BaseAddon, Z as evaluateZoneRules, Zt as hydrateSchema, pt as motionDetectionCapability, qt as DeviceType } from "../dist-CEFC3PkP.mjs";
|
|
2
2
|
import { t as getSharp } from "../lazy-sharp-DXsqwpph.mjs";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
+
const require_dist = require("./dist-ATDfcxgL.js");
|
|
2
3
|
let node_crypto = require("node:crypto");
|
|
3
4
|
let node_fs = require("node:fs");
|
|
4
|
-
node_fs =
|
|
5
|
+
node_fs = require_chunk.__toESM(node_fs, 1);
|
|
5
6
|
let node_path = require("node:path");
|
|
6
|
-
node_path =
|
|
7
|
+
node_path = require_chunk.__toESM(node_path, 1);
|
|
7
8
|
require("node:child_process");
|
|
8
9
|
let node_fs_promises = require("node:fs/promises");
|
|
9
10
|
var DEFAULT_FIRST_UNIT_TIMEOUT_MS = 12e3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as buildFfmpegArgs, Ht as isSoftwareDecode, Lt as errMsg, zt as Fmp4BoxSplitter } from "./dist-CEFC3PkP.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { realpathSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|