Skip to main content

Arctan Voice Isolation for voice agents

Project description

Arctan Voice Isolation

Arctan Voice Isolation is a Python SDK for real-time voice isolation in voice agents and audio pipelines.

The SDK supports:

  • standard Numpy audio processing
  • LiveKit audio input processing
  • Pipecat audio input filtering

An Arctan SDK key is required before audio can be processed.

Installation

Install the base SDK:

pip install arctan-vi

Install with framework adapters:

pip install "arctan-vi[livekit]"
pip install "arctan-vi[pipecat]"

The base SDK and LiveKit adapter support Python 3.10+. The Pipecat adapter requires Python 3.11+.

Set your SDK key in the runtime environment:

export ARCTAN_SDK_KEY="arc_sk_live_..."

You can also pass license_key="arc_sk_live_..." directly to the processor or adapter constructors. An explicit license_key takes precedence over ARCTAN_SDK_KEY.

Standard Python

Process one stream

The existing single-stream API remains supported. It creates and owns its model internally:

import numpy as np
import arctan

config = arctan.ProcessorConfig(sample_rate=24000, num_channels=1)
processor = arctan.Processor(config=config)

try:
    audio = np.zeros((config.num_channels, config.num_frames), dtype=np.float32)
    enhanced = processor.process(audio)
finally:
    processor.close()

Process concurrent streams

For multiple streams in one worker process, create one shared Model and one ProcessorAsync per call or audio stream. ProcessorAsync runs blocking native inference off the event loop while keeping frames within each stream ordered.

import asyncio
import numpy as np
import arctan


async def main() -> None:
    model = arctan.Model()
    configs = [arctan.ProcessorConfig.optimal(model) for _ in range(2)]
    processors = [
        arctan.ProcessorAsync(model=model, config=config)
        for config in configs
    ]

    try:
        frames = [
            np.zeros((config.num_channels, config.num_frames), dtype=np.float32)
            for config in configs
        ]
        enhanced = await asyncio.gather(
            *(
                processor.process_async(frame)
                for processor, frame in zip(processors, frames)
            )
        )
        print(len(enhanced))
    finally:
        for processor in processors:
            processor.close()
        model.close()


asyncio.run(main())

Use one shared Model per worker process and exactly one processor per call or audio stream. Do not share one processor between independent streams or submit one stream's frames out of order. Different processors may execute concurrently, but calls on the same ProcessorAsync are serialized. Close every processor before closing its shared model.

The number of processors is the number of active streams, not a universal capacity guarantee. Benchmark the deployment machine using representative audio and retain CPU and RSS headroom for transport, codecs, logging, and application work.

Processor.process() accepts float32 audio shaped as channels x frames. Samples must be finite and in [-1.0, 1.0]. The output is a new float32 array with the same shape.

Mono and stereo input are supported. Stereo input is downmixed for voice isolation and returned as dual-mono stereo. The sample rate must remain stable for the lifetime of a processor.

If num_frames is omitted, initialization fills it with the native frame size for the selected sample rate. If you set num_frames, it must contain a whole number of native processing blocks.

LiveKit

Install the LiveKit extra:

pip install "arctan-vi[livekit]"

Create an Arctan noise-cancellation processor and pass it to LiveKit audio input options:

from arctan.livekit import arctan_enhancer
from livekit.agents import room_io

await session.start(
    agent=Assistant(),
    room=ctx.room,
    room_options=room_io.RoomOptions(
        audio_input=room_io.AudioInputOptions(
            noise_cancellation=arctan_enhancer.noise_canceller(),
        ),
    ),
)

You can pass SDK options directly to Arctan:

noise_cancellation = arctan_enhancer.noise_canceller(
    license_key="arc_sk_live_...",
)

LiveKit mono and stereo frames are supported. Stereo frames are downmixed for voice isolation and returned as dual-mono stereo. The sample rate must remain stable, and each input frame must contain a whole number of native processing blocks.

Create a separate noise-canceller instance for every participant, call, or independent audio input. Do not share one instance across concurrent streams.

Pipecat

Install the Pipecat extra:

pip install "arctan-vi[pipecat]"

Create an ArctanAudioFilter and pass it as the input audio filter for your transport:

from arctan.pipecat import arctan_enhancer
from pipecat.transports.base_transport import TransportParams

audio_filter = arctan_enhancer.ArctanAudioFilter()

transport_params = TransportParams(
    audio_in_enabled=True,
    audio_in_filter=audio_filter,
)

ArctanAudioFilter implements Pipecat's BaseAudioFilter. Pipecat calls start(sample_rate), filter(audio), and stop() through the transport lifecycle.

The Pipecat adapter accepts mono PCM16 input. Arbitrary byte chunks are buffered until a complete native processing block is available, so filter() may return b"". FilterEnableFrame can bypass or re-enable processing; toggling clears any incomplete buffered block.

Create a separate ArctanAudioFilter for every call or pipeline. Do not share one filter across independent concurrent streams.

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.

arctan_vi-0.7.2-cp314-cp314-win_amd64.whl (459.6 kB view details)

Uploaded CPython 3.14Windows x86-64

arctan_vi-0.7.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.35+ x86-64

arctan_vi-0.7.2-cp314-cp314-macosx_11_0_arm64.whl (513.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

arctan_vi-0.7.2-cp313-cp313-win_amd64.whl (451.5 kB view details)

Uploaded CPython 3.13Windows x86-64

arctan_vi-0.7.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.35+ x86-64

arctan_vi-0.7.2-cp313-cp313-macosx_11_0_arm64.whl (511.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

arctan_vi-0.7.2-cp312-cp312-win_amd64.whl (455.8 kB view details)

Uploaded CPython 3.12Windows x86-64

arctan_vi-0.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.35+ x86-64

arctan_vi-0.7.2-cp312-cp312-macosx_11_0_arm64.whl (517.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

arctan_vi-0.7.2-cp311-cp311-win_amd64.whl (468.0 kB view details)

Uploaded CPython 3.11Windows x86-64

arctan_vi-0.7.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.35+ x86-64

arctan_vi-0.7.2-cp311-cp311-macosx_11_0_arm64.whl (522.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

arctan_vi-0.7.2-cp310-cp310-win_amd64.whl (465.3 kB view details)

Uploaded CPython 3.10Windows x86-64

arctan_vi-0.7.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.35+ x86-64

arctan_vi-0.7.2-cp310-cp310-macosx_11_0_arm64.whl (526.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file arctan_vi-0.7.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: arctan_vi-0.7.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 459.6 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arctan_vi-0.7.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5cf265b86dcadfab2d51567fd8cd34b5ac21f68b4509fb40097997865102f23d
MD5 fcd8c79e5bc5e77b0e836183efe950cf
BLAKE2b-256 5f9833d8de2fe057d9fcd70d4d67f2710796f823a11597ae7b3bf80f4c97d037

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 543e415cc3742dbe9ee861768089886dc9fc5380426f3eed12ede03ded5c9900
MD5 d593a0692d01c1829ac45c4b443f33c7
BLAKE2b-256 cfebeffb461168baea442f2920047fdfe7ddf28c707255171509fc41f06f6f4c

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9aed6d88b037ac4248c5dad95b851f76801dacb2231fd15b9f4104917cadb83a
MD5 2f15723b22fc2da67256162aaf641875
BLAKE2b-256 97b9ba7fba303b1d00f6347ab822c457b7c2cf188c61133159dff58d0e6655fb

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: arctan_vi-0.7.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 451.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arctan_vi-0.7.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c9f0738810468d0d463cbe075a08659c6e0543cd91fe26d3a2c3e70937c1ba26
MD5 154c85740eb41caddf5b4d55993b4f68
BLAKE2b-256 4a3a4f09f72d69660660a858f3ba3272787ddf3f4fd62a84e113bbe326340c89

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0bdc0e2bc36bf0fab44aa599486ce5a17309097062bfd831539ec59e09a8e2d3
MD5 37f15e3b9e444d0ec99799de90461270
BLAKE2b-256 21732fd525690721c67ce5858e35bcf99d8a69f57b5c5eb0804534708ef5dda3

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2abaf5c09d25b480fcf33e603457c256854faf7bd302bab75e95e93eff952bf6
MD5 6aa5a3156106cc1ce236d15674f96327
BLAKE2b-256 a7fe819ac467924e5a8b8739e4ce24dd68e32f57b957afdb2f615da76dad464e

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: arctan_vi-0.7.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 455.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arctan_vi-0.7.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f63841d12af6c8825da3dadeb338d226e1e0ba889d4098a2e85a2833aa77e629
MD5 59e88fa935e160b158e4f8565e0abad3
BLAKE2b-256 f173800e7ceb419fc9e2d5f51ade653b1187ed662c0f6d4ff7a6d8d4122ece0f

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d9fb2728b7a8cd5f764c6e26c89c4f8a90d8bce4b61fe779763de0a9016e80c0
MD5 df76f87d167a3a645f60eaad5008a26a
BLAKE2b-256 863ecbb3402bad48412cad50bb81ef543528ded07b5d4856c9383a74baf19d6f

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 617a184185c6897d4ee566fb10952548cd933d5ed06bc5a53166471a80f7a297
MD5 8b0348a0e4faa4648c48cc6805a2ee84
BLAKE2b-256 b2ea3d21a8ed153776c452467cc6cdb920811d4fe453a7dea1eab83a55d5ff2c

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: arctan_vi-0.7.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 468.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arctan_vi-0.7.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 252a408b66af70bb438cfa0b849337441e4826e7b9acd2327c9af95ad1faca85
MD5 344e67e0d81c642ce9020367f6ad9a7d
BLAKE2b-256 5ec310ba00a3d578edbb3fd35178ad8059bb6ffb3b24daf6c7acc0b2d57cdaa6

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 66c499407f326a78e58f390d91fa1f611af0aad6fae5f7b30d85a3ce1b37a142
MD5 28870223cbfb2d8eb2e4a2429fc1bbc3
BLAKE2b-256 6b2205f041d8c6873d1dd2f8d07dd50b93797bbc6ba9c9618f87d0aa9da21a3b

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aedf9240decc788da284fbd0b512ab0c99f8809a8eb1d3ae4c090bbf785fe229
MD5 f40b918438bf1d1c24b81eb64857adc9
BLAKE2b-256 a0ab9a4297287b57bcde3b21209fa408c8e9c20db4015c5bf0b397fbd2d54f1f

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: arctan_vi-0.7.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 465.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for arctan_vi-0.7.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 706fe808ff735b88a1a40f42dbaf7e2bfedba0b6c8425b2f490ec32099283240
MD5 abc743d1acc9a1c8f5154113c5427a85
BLAKE2b-256 c838eeb7fed90cf7a113b80c97cdfd2040a1b1c5f570c325dc47d479254a349c

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 0c75b624d1792afce05de569935897345e24720efd989348193e778eb7108c02
MD5 3e122c3d97d599b6ce0f2d6e556e8b8d
BLAKE2b-256 d63d2e04c96d9d5d05ad53b1478ba155b2b5b44c5904eb4ed5d1cb3df9fbbb4e

See more details on using hashes here.

File details

Details for the file arctan_vi-0.7.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for arctan_vi-0.7.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3278c839c9d587f534d407a2a50c89c07e00d833e6aa35431f01ac4258e5faf6
MD5 c4b033a5f42fdc9de1085c70b86a26d1
BLAKE2b-256 a4e908592b9d0760863a4ddeff367a85b57d200e1216025bf7de5ba4ada722ae

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