Metadata-Version: 2.5
Name: pipecat-alkove
Version: 0.2.0
Summary: Alkove for Pipecat: AlkoveFilter keeps the user's voice, AlkoveVADAnalyzer finds speech, on the bot's CPU
Project-URL: Homepage, https://alkove.ai
Project-URL: Repository, https://github.com/alkove-ai/alkove
Author: Eddy Bordi
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: noise-cancellation,on-device,pipecat,vad,voice,voice-agent,voice-isolation
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10
Requires-Dist: alkove<0.3,>=0.2
Requires-Dist: numpy>=1.21
Requires-Dist: pipecat-ai<2,>=1.0
Description-Content-Type: text/markdown

# pipecat-alkove

[Alkove](https://alkove.ai) for [Pipecat](https://github.com/pipecat-ai/pipecat): `AlkoveFilter` keeps the user's voice and removes the others and the noise (Focus), `AlkoveVADAnalyzer` finds where they speak (Cue). Both run on the bot's CPU, with no server and no key, with the chain of Alkove's web SDK; where speech starts and ends is Pipecat's `VADParams`.

Maintained by Alkove, not by the Pipecat team.

## Install

```sh
pip install pipecat-alkove
```

The models (Focus 1.1 MB, Cue 1.1 MB) are downloaded once into the cache and checked by their sha256: the analyzer loads them when it is created, as Silero's does, the filter when the transport starts. Pass `models=alkove.Models.load(["focus", "cue"], dir=...)` to read them from your own folder.

## Use

```python
from pipecat.audio.vad.vad_analyzer import VADParams
from pipecat.transports.base_transport import TransportParams
from pipecat_alkove import AlkoveFilter, AlkoveVADAnalyzer

params = TransportParams(audio_in_enabled=True, audio_in_filter=AlkoveFilter())
vad = AlkoveVADAnalyzer()  # VADParams(confidence=0.5) unless you pass params
```

Give the analyzer to your user aggregator (`LLMUserAggregatorParams(vad_analyzer=vad)`) or to a `VADProcessor`, as you would Silero's.

- **`AlkoveFilter`** keeps the closest voice, or with `voiceprint=` the voice of that print; `strength=` and `normalize=` work as in the web SDK. It works at the transport's input rate. `FilterEnableFrame(False)` gives the raw microphone back at the same delay; `FilterUpdateSettingsFrame(settings={"strength": 0.5})` and `{"voiceprint": ...}` change it while it runs. It returns the samples that are ready: a little less than the input at the start (Focus's 16 ms), then about the input's size.
- **`AlkoveVADAnalyzer`** gives Cue's speech probability every 30 ms, at any input rate. Cue was tuned with a confidence of 0.5, so that is its default. Behind `AlkoveFilter`, it hears only the user.

`example.py` runs both on your microphone and prints when you speak.

Tested with pipecat-ai 1.13.0.

## License

Apache-2.0. See [NOTICE](./NOTICE).
