Dominevo
ReferenceDevice capabilities

audio-metrics

Audio Metrics capability — sliding-window aggregates over the pipeline audio inference results.

Audio Metrics capability — sliding-window aggregates over the pipeline audio inference results. Hosted by addon-pipeline-analytics (same addon that owns zone-analytics); the runtime-state slice gives operators a live read on dB level + dominant classes without a custom event subscription.

At a glance

Capabilityaudio-metrics
Provided byOne addon provides it for every device and answers by device id.
Active providers per deviceone
Device typescamera
Sourcepackages/types/src/capabilities/audio-metrics.cap.ts

Methods

Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.

MethodKindRequired of a providerAccess
getCurrentSnapshotqueryyesdefault
getHistoryqueryyesdefault

getCurrentSnapshot

query

Latest snapshot for this device. Null until the analytics pipeline has processed at least one audio window.

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
tsnumberyes
windowSecnumberyes
level{ rms: number; dbfs: number }yes
peakDbfsnumberyes
avgDbfsnumberyes
current{ className: string; score: number; timestamp: number } | nullyes
byClass({ className: string; hits: number; avgScore: number; peakScore: number })[]yes

getHistory

query

Time-series view of recent audio-metrics samples. The provider keeps an in-memory ring of ~1Hz samples (matching the slice- write rate) capped at MAX_HISTORY_POINTS_KEPT (provider-side). windowSec selects how far back to read; sampleEveryMs downsamples by bucketed averaging when finer than the kept granularity. Empty points array on freshly-booted providers with no audio yet — same convention as getCurrentSnapshot.

Input

FieldTypeRequiredDescription
windowSecnumbernoHistory window in seconds. Default 300 (5 minutes). Provider clamps to its retention cap if larger.
sampleEveryMsnumbernoTarget sample interval in ms. Default 1000 (1 sample/second). Provider clamps to natural sample rate if smaller, and bucket-averages when bigger than the requested window would produce more than maxPoints samples.

Output

Audio-metrics history payload — a series of AudioMetricsHistoryPoint samples capped at maxPoints (default 1024). When the requested windowSec / sampleEveryMs would exceed the cap, the provider subsamples by bucketed averaging and reports the effective sample spacing on effectiveSampleEveryMs so the UI can label the x-axis.

FieldTypeRequiredDescription
points({ ts: number; dbfs: number | null; peakDbfs: number; avgDbfs: number; topClass: string | null; topScore: number | null })[]yes
effectiveSampleEveryMsnumberyesActual ms between adjacent samples after any subsampling.
windowMsActualnumberyesWall-clock window covered by points (points[N-1].ts - points[0].ts), or 0 when there's fewer than 2 samples.

Runtime state

The state Dominevo keeps for each device with this capability, readable without calling the provider.

Reactive runtime-state mirror — live device.state.audioMetrics.value.

FieldTypeRequiredDescription
tsnumberyesWall-clock timestamp (ms) of the most recent audio window.
windowSecnumberyesSliding-window length (seconds) used for aggregation.
level{ rms: number; dbfs: number }yesLatest level reading from the most recent window.
peakDbfsnumberyesPeak dBFS observed across the rolling window.
avgDbfsnumberyesMean dBFS across the rolling window.
current{ className: string; score: number; timestamp: number } | nullyesMost recent above-threshold classification, or null on silence.
byClass({ className: string; hits: number; avgScore: number; peakScore: number })[]yesPer-class summary across the rolling window — keys are macroClass strings (e.g. dog_bark, speech, glass_break).