API Reference / AudioSpan
Type Alias: AudioSpan
ts
type AudioSpan = {
from: number;
to: number;
contextTime: number | null;
};Defined in: contract/types.ts:177
The audio a reading covers, in seconds of analysed audio since the epoch began (since the analyzer started or since the last reset()). Lost live input counted as silence is included, so this is audio time, not wall time. from <= to, and to never decreases within an epoch.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
from | readonly | number | - | contract/types.ts:178 |
to | readonly | number | - | contract/types.ts:179 |
contextTime | readonly | number | null | Realtime: the AudioContext.currentTime at which the last analysed sample, the one at to, reached the analyzer, stamped in the worklet. It anchors audio time to the context clock: a moment t of analysed audio (a beat, in 6.x) is at contextTime - (to - t) on the clock AudioContext schedules on. That holds back to the last lost live input, which audio time counts as silence. The time the sound reached the analyzer, so add outputLatency to line something up with what the listener hears. null offline, where no context clock runs. | contract/types.ts:189 |