Skip to content

alkove.Chain

class Chain(
models: Models,
*,
gate: bool = False,
normalize: bool = True,
strength: float = 1.0,
voiceprint: Any = None,
speech: Optional[SpeechParams] = None,
sleep: bool = True,
)

The real-time chain, one hop of 256 samples at 16 kHz at a time: Focus, Cue, the mix with the raw mic, the level, the gate. Its output is delay samples late.

step(hop: Any) -> Tuple[np.ndarray, List[dict]]

One hop in, one hop out, and the events it gave (speech, idle, diag).

set_voiceprint(embedding: Any) -> None

Applied at the next silence, from a fresh state; None goes back to the closest voice.

set_strength(s: float) -> None

How much of Focus goes out, 0 to 1, the rest being the raw mic: 0.8 is 80 % Focus.

set_enabled(on: bool) -> None

Off: the raw mic, at the same delay, with a short fade.

Attribute Type Description
HOP int = 256 The samples of one step, at 16 kHz: 16 ms.
delay int Samples between a sample going in and coming out: Focus’s lag, plus the gate’s look-ahead with gate.
speaking bool Cue hears speech now.
sleeping bool Focus and Cue paused in a silence (sleep): after 2 s of quiet, until the mic rises 9 dB over its noise floor.
gain_db float The gain normalize applies now, in dB.