API Reference / EngineOption
Type Alias: EngineOption
ts
type EngineOption =
| EngineName
| {
name: "peaks";
restartAfterSeconds?: number;
}
| {
name: "tempogram";
mode?: "measured";
};Defined in: contract/types.ts:47
The realtime engine option: a bare name, or a name with the settings only that engine understands. Realtime and offline take different settings, so each has its own type and none is accepted where it does nothing. An object takes name and that engine's settings only: restartAfterSeconds for peaks, mode for tempogram. Any other key, such as lowpass (realtime peaks has a fixed lowpass inside analyzer.input) or a typo, makes the factory's promise reject with a TypeError that names it, whatever its value. null or undefined means the default, tempogram.
Union Members
Type Literal
ts
{
name: "peaks";
restartAfterSeconds?: number;
}| Name | Type | Description | Defined in |
|---|---|---|---|
name | "peaks" | - | contract/types.ts:50 |
restartAfterSeconds? | number | Discard the history and start over every this many seconds of audio, so a tempo change is followed. A restart outside listening is a statechange to listening with reason tempo-changed; a restart while still listening is silent, as nothing was reported yet. Absent: never restarts. | contract/types.ts:56 |
Type Literal
ts
{
name: "tempogram";
mode?: "measured";
}| Name | Type | Description | Defined in |
|---|---|---|---|
name | "tempogram" | - | contract/types.ts:59 |
mode? | "measured" | measured holds the analyzer to the settings the benchmark measured, on real-time audio at 90 to 180 BPM: it reads exactly as the bare tempogram does, and refuses another tempoRange. | contract/types.ts:64 |