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.3.0-py3-none-win_amd64.whl (65.8 MB view details)

Uploaded Python 3Windows x86-64

livekit_plugins_noise_cancellation-0.3.0-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.3.0-py3-none-manylinux_2_28_aarch64.whl (70.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

livekit_plugins_noise_cancellation-0.3.0-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.3.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7f6001d0dd3b00c7748949b7a8349de002118fc03faa2d38411ad0d05180ccab
MD5 3a86706374b5fc2f8c6f2549fd95d673
BLAKE2b-256 6fb43ed7bac7aabec196c1e8969b407b71f69bdb0c942b1b3cd2aed07ae276cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.3.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1703099d634d26171e2f0402c81fc84f13bf0bc92a7f9ba16f9af1d0eefee980
MD5 fc9f8d16092518d0a8ce7de39be645f8
BLAKE2b-256 d143701df4746e4e8b660f1399ec0a3da80de211f1624725a7496d28f7443b4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.3.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4b48de9ffdb8af47820ecd5e44ef0dbb910dfd05f17f6fadcbfd64deceb7a09a
MD5 5b2466e6cba7362e0e855377202559d2
BLAKE2b-256 2d0ddf886e71b463911a9190cea948100f89c1e0546cff7e84dd93862b73e2d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d100f249d25556696d8fe358b7c22d81017df67f256ee3b5c9c36830409621f
MD5 b0d8fb24d7c5a31255eaea2a5e0aecda
BLAKE2b-256 07617a860386cf0c9d27f4d3fdcfeee411153e1618552d6a15ad46d32df64ac5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for livekit_plugins_noise_cancellation-0.3.0-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6c877ca3f31278ce3b6ba7a3adc0eaaf813a53ba5a900445616be69ce7e4b3a8
MD5 82fd48d2121efa6b59c0d39853f10ab2
BLAKE2b-256 d8ade049eeca9c5175cc70c036c6dc5ce048215949b5d7ea83dbea6e2e06260c

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