livekit-plugins-denoise 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- livekit/plugins/telephony_denoise/__init__.py +32 -0
- livekit/plugins/telephony_denoise/_buffers.py +53 -0
- livekit/plugins/telephony_denoise/_resample.py +257 -0
- livekit/plugins/telephony_denoise/echo_reference.py +159 -0
- livekit/plugins/telephony_denoise/log.py +3 -0
- livekit/plugins/telephony_denoise/neural.py +222 -0
- livekit/plugins/telephony_denoise/processor.py +455 -0
- livekit/plugins/telephony_denoise/py.typed +0 -0
- livekit/plugins/telephony_denoise/version.py +1 -0
- livekit_plugins_denoise-0.1.0.dist-info/METADATA +136 -0
- livekit_plugins_denoise-0.1.0.dist-info/RECORD +14 -0
- livekit_plugins_denoise-0.1.0.dist-info/WHEEL +4 -0
- livekit_plugins_denoise-0.1.0.dist-info/licenses/LICENSE +21 -0
- livekit_plugins_denoise-0.1.0.dist-info/licenses/NOTICE +11 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: livekit-plugins-denoise
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Self-hosted noise and echo suppression for LiveKit SIP telephony
|
|
5
|
+
Project-URL: Source, https://github.com/jaffarjawed/livekit-plugins-denoise
|
|
6
|
+
Project-URL: Issues, https://github.com/jaffarjawed/livekit-plugins-denoise/issues
|
|
7
|
+
Author: BotifyNow
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Keywords: audio,echo-cancellation,livekit,noise-cancellation,sip,telephony,webrtc
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Communications :: Telephony
|
|
21
|
+
Classifier: Topic :: Multimedia :: Sound/Audio
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: deepfilter-stream<0.2,>=0.1.0
|
|
24
|
+
Requires-Dist: livekit-agents<2.0,>=1.6.0
|
|
25
|
+
Requires-Dist: livekit<2.0,>=1.1.0
|
|
26
|
+
Requires-Dist: numpy>=1.26
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-asyncio<2,>=1.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
31
|
+
Requires-Dist: twine>=6; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# livekit-plugins-denoise
|
|
35
|
+
|
|
36
|
+
Self-hosted noise suppression and acoustic echo cancellation for LiveKit SIP
|
|
37
|
+
agents.
|
|
38
|
+
|
|
39
|
+
- Removes background noise with DeepFilterNet3 or low-latency WebRTC noise
|
|
40
|
+
suppression.
|
|
41
|
+
- Removes the agent's voice when it returns through a caller's handset or
|
|
42
|
+
carrier path.
|
|
43
|
+
- Runs in your agent process: no per-minute denoising fee and no language
|
|
44
|
+
dependency.
|
|
45
|
+
|
|
46
|
+
This is an independent, community-maintained package and is not affiliated
|
|
47
|
+
with or endorsed by LiveKit, Inc.
|
|
48
|
+
|
|
49
|
+
## Why this exists
|
|
50
|
+
|
|
51
|
+
LiveKit's managed `BVCTelephony` noise-cancellation option is billed per minute.
|
|
52
|
+
This package is a self-hosted, MIT-licensed alternative for teams that want
|
|
53
|
+
noise suppression and echo cancellation in their own agent process without a
|
|
54
|
+
per-minute denoising charge. You still pay for your own compute, telephony, and
|
|
55
|
+
other services.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
python -m pip install livekit-plugins-denoise
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For local development:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python -m pip install -e ".[dev]"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Enable noise suppression and echo cancellation
|
|
70
|
+
|
|
71
|
+
Create one `TelephonyDenoiser` for each call. `EchoReferenceTap` is required
|
|
72
|
+
for echo cancellation because it supplies the agent's outgoing audio as the
|
|
73
|
+
far-end reference.
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from livekit.agents import room_io
|
|
77
|
+
from livekit.plugins import telephony_denoise
|
|
78
|
+
|
|
79
|
+
denoiser = telephony_denoise.TelephonyDenoiser(
|
|
80
|
+
telephony_denoise.DenoiseOptions(
|
|
81
|
+
echo_cancellation=True,
|
|
82
|
+
noise_suppression=True,
|
|
83
|
+
high_pass_filter=True,
|
|
84
|
+
auto_gain_control=True,
|
|
85
|
+
enhancer="deepfilter", # use "webrtc" for lower latency
|
|
86
|
+
stream_delay_ms=120,
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
await session.start(
|
|
91
|
+
agent=agent,
|
|
92
|
+
room=room,
|
|
93
|
+
room_options=room_io.RoomOptions(
|
|
94
|
+
audio_input=room_io.AudioInputOptions(
|
|
95
|
+
noise_cancellation=denoiser,
|
|
96
|
+
auto_gain_control=False, # do not stack AGC
|
|
97
|
+
),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# Add this after session.start(); RoomIO replaces the output during startup.
|
|
102
|
+
session.output.audio = telephony_denoise.EchoReferenceTap(
|
|
103
|
+
denoiser, next_in_chain=session.output.audio
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
To load the neural model before the first call:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
def setup(proc):
|
|
111
|
+
telephony_denoise.prewarm()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
See [examples/sip_agent.py](examples/sip_agent.py) for a complete SIP agent.
|
|
115
|
+
|
|
116
|
+
## Configuration
|
|
117
|
+
|
|
118
|
+
`DenoiseOptions` lets you control these features independently:
|
|
119
|
+
|
|
120
|
+
| Option | Default | Purpose |
|
|
121
|
+
| --- | --- | --- |
|
|
122
|
+
| `echo_cancellation` | `True` | Cancels the agent's returned audio; requires `EchoReferenceTap`. |
|
|
123
|
+
| `noise_suppression` | `True` | Removes background noise. |
|
|
124
|
+
| `enhancer` | `"deepfilter"` | Use `"webrtc"` when minimizing latency is more important. |
|
|
125
|
+
| `high_pass_filter` | `True` | Reduces low-frequency rumble and hum. |
|
|
126
|
+
| `auto_gain_control` | `True` | Helps keep quiet callers audible. |
|
|
127
|
+
| `stream_delay_ms` | `120` | Starting delay estimate for SIP echo paths. |
|
|
128
|
+
|
|
129
|
+
For tuning, supported formats, model download behavior, and operating notes, see
|
|
130
|
+
[Technical notes](docs/technical-notes.md).
|
|
131
|
+
|
|
132
|
+
## Community
|
|
133
|
+
|
|
134
|
+
Issues, documentation improvements, and pull requests are welcome. See
|
|
135
|
+
[CONTRIBUTING.md](CONTRIBUTING.md). This project is MIT licensed; dependency
|
|
136
|
+
attribution is in [NOTICE](NOTICE).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
livekit/plugins/telephony_denoise/__init__.py,sha256=RpYNx9Ksds_JXLtwdo5IH8tYfE-KSHmj2y8t54VjMlY,948
|
|
2
|
+
livekit/plugins/telephony_denoise/_buffers.py,sha256=L6OnKb3mdTxXtn5faNzT7FaM6QWHObidhmqdOJuwyjs,1780
|
|
3
|
+
livekit/plugins/telephony_denoise/_resample.py,sha256=ruWT114RsroZU9ImQNsOz_oFX8wFCHvwuWZzjdYEz5Y,10689
|
|
4
|
+
livekit/plugins/telephony_denoise/echo_reference.py,sha256=OuFccFmY1TLU9WLbigcZybH7bSb3wJ94NCqMAE2jDCM,5683
|
|
5
|
+
livekit/plugins/telephony_denoise/log.py,sha256=R6UX7a6AqNQQ9vP4GAmETmAvQIkqwDMAwYThJD0D3Gk,83
|
|
6
|
+
livekit/plugins/telephony_denoise/neural.py,sha256=n-TgbqZdOQfp2XhK43s5k1gEjDckAb3-kPr-9V1Ujgw,8825
|
|
7
|
+
livekit/plugins/telephony_denoise/processor.py,sha256=j40tUsnCPb1MqlDYZGa3NU3K_kfSvhoH5WoADO-_vO8,16935
|
|
8
|
+
livekit/plugins/telephony_denoise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
livekit/plugins/telephony_denoise/version.py,sha256=QTYqXqSTHFRkM9TEgpDFcHvwLbvqHDqvqfQ9EiXkcAM,23
|
|
10
|
+
livekit_plugins_denoise-0.1.0.dist-info/METADATA,sha256=-j6vwrWlmqVe92Ltvhfi5DxWJh3zYIgDEuX7UGHl7OM,4563
|
|
11
|
+
livekit_plugins_denoise-0.1.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
12
|
+
livekit_plugins_denoise-0.1.0.dist-info/licenses/LICENSE,sha256=e0vEReJqJfrWqD7e0c_aJeVjfzRxbqNRNiDLNd7TU7I,1066
|
|
13
|
+
livekit_plugins_denoise-0.1.0.dist-info/licenses/NOTICE,sha256=76fDv7NQVGpt4tIhW-e2hVsLIrz7m19eQEKRMFUyzKw,454
|
|
14
|
+
livekit_plugins_denoise-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BotifyNow
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
livekit-plugins-denoise
|
|
2
|
+
Copyright 2026 BotifyNow
|
|
3
|
+
|
|
4
|
+
This package depends on deepfilter-stream, which bundles DeepFilterNet3 model
|
|
5
|
+
weights. deepfilter-stream and DeepFilterNet are dual-licensed under MIT or
|
|
6
|
+
Apache-2.0 at the recipient's option.
|
|
7
|
+
|
|
8
|
+
DeepFilterNet attribution:
|
|
9
|
+
H. Schröter, T. Rosenkranz, A. N. Escalante-B., and A. Maier,
|
|
10
|
+
"DeepFilterNet: A Low Complexity Speech Enhancement Framework for Full-Band
|
|
11
|
+
Audio based on Deep Filtering", IWAENC 2022.
|