Skip to main content

Livekit plugin for noise cancellation of inbound AudioStream

Project description

Enhanced Noise Cancellation Plugin for LiveKit

Add realtime enhanced noise cancellation to inbound AudioStream. Fully compatible with LiveKit Agents.

Requires LiveKit Cloud.

Read more in the documentation

Audio chain

This package runs server-side on inbound audio (e.g. in an agent or on an AudioStream). Remote participants’ tracks are cleaned before your code or the agent consumes the audio.

flowchart LR
  Room["LiveKit room"] --> Track["Remote track (inbound)"]
  Track --> NC["livekit.plugins.noise_cancellation"]
  NC --> Stream["AudioStream / Agent input"]
  Stream --> Consumer["Your code or agent"]

Usage

In LiveKit Agents

Include the filter in RoomInputOptions when starting your AgentSession:

from livekit.plugins import noise_cancellation

# ...
await session.start(
    # ...,
    room_input_options=room_io.RoomInputOptions(
        noise_cancellation=noise_cancellation.BVC(),
    ),
)
# ...

On AudioStream

Noise cancellation can also be applied to any individual inbound AudioStream:

from livekit.rtc import AudioStream
from livekit.plugins import noise_cancellation

stream = AudioStream.from_track(
    track=track,
    noise_cancellation=noise_cancellation.BVC(),
)

Available Models

There are three noise cancellation models available:

# Standard enhanced noise cancellation (NC)
noise_cancellation.NC()

# Background voice cancellation (NC + removes non-primary voices
# that would confuse transcription or turn detection)
noise_cancellation.BVC()

# Background voice cancellation optimized for telephony applications
noise_cancellation.BVCTelephony()

Notes

Noise cancellation only needs to be applied once, so if you choose to apply it here you should disable noise cancellation / Krisp filter in your frontend clients.

If you experience crashes when using noise_cancellation (especially on AMD CPUs), it may be due to a failure in OpenBLAS's CPU detection. Manually setting the OPENBLAS_CORETYPE environment variable to a more conservative value (e.g., Haswell) may resolve the issue.

License

See: https://livekit.io/legal/terms-of-service

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

livekit_plugins_noise_cancellation-0.2.6-py3-none-win_amd64.whl (65.8 MB view details)

Uploaded Python 3Windows x86-64

livekit_plugins_noise_cancellation-0.2.6-py3-none-manylinux_2_28_x86_64.whl (73.0 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

livekit_plugins_noise_cancellation-0.2.6-py3-none-manylinux_2_28_aarch64.whl (70.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

livekit_plugins_noise_cancellation-0.2.6-py3-none-macosx_11_0_arm64.whl (64.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

livekit_plugins_noise_cancellation-0.2.6-py3-none-macosx_10_9_x86_64.whl (66.1 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file livekit_plugins_noise_cancellation-0.2.6-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.2.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d8b7a0876124cdd861dec657c7d698b3a7cab09ccb11c3af0fc536b0b43c42b2
MD5 e58f426ecd31a04a2c39b5b93978a3ab
BLAKE2b-256 16a42ec98ead17ae6cb9e488a11baf9c91b4c4767af16611eacf36e084122364

See more details on using hashes here.

File details

Details for the file livekit_plugins_noise_cancellation-0.2.6-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.2.6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a01ebe5a610ef693a5b5b24e077c1d677bab365ac9316c1339850ad0960c87ec
MD5 73a04e85a326bfe99844c5fb2c464f65
BLAKE2b-256 babdea16d2492cd159e4685ca4160864e7d55bfaf8d199dbd4b5433cb366d0d0

See more details on using hashes here.

File details

Details for the file livekit_plugins_noise_cancellation-0.2.6-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.2.6-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ae3598ac886b239faeed7bbe2ca1b20e6066d5744da80618d0a9d7fc7fa70fba
MD5 4afdf810785fa4df68a92b4041629ebd
BLAKE2b-256 725c8f4623bbc665a0552a1ee6089dc346f5bf0b929b49afb174cd1085411ac5

See more details on using hashes here.

File details

Details for the file livekit_plugins_noise_cancellation-0.2.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.2.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c50b8ace36e5a75ea096af38c9a799b325676db7b9a5f0d67a228f222e0150a
MD5 4df136442b9f167d648334820215a686
BLAKE2b-256 63a736b7800a9dc7ef167b3e47cc8b53620cfe8fd3d6d2d374ae11ebbbd39ffc

See more details on using hashes here.

File details

Details for the file livekit_plugins_noise_cancellation-0.2.6-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.2.6-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6a607767abfc266a5fa9d90fc549371fc2f91401f761b4ca89227e04ce4fa8b5
MD5 ca2b5d3f6618e0eee89ad50faec51859
BLAKE2b-256 1990fdb859b5745feb0b130b89b2d6bf0433fb70346d87e0307518cfc9c57c11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page