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.
Methods
Section titled “Methods”step()
Section titled “step()”step(hop: Any) -> Tuple[np.ndarray, List[dict]]One hop in, one hop out, and the events it gave (speech, idle, diag).
set_voiceprint()
Section titled “set_voiceprint()”set_voiceprint(embedding: Any) -> NoneApplied at the next silence, from a fresh state; None goes back to the closest voice.
set_strength()
Section titled “set_strength()”set_strength(s: float) -> NoneHow much of Focus goes out, 0 to 1, the rest being the raw mic: 0.8 is 80 % Focus.
set_enabled()
Section titled “set_enabled()”set_enabled(on: bool) -> NoneOff: the raw mic, at the same delay, with a short fade.
Attributes
Section titled “Attributes”| 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. |