Skip to content

SDK Overview & Quick Starts

capture-system-or-process-audio provides four first-class native bindings built directly on the unified #![forbid(unsafe_code)] Rust facade — with zero OS-specific #ifdef / #[cfg] leaks in any binding layer.

SDK Distribution Key Ergonomics & Runtime Guarantees Status
Python (3.11–3.15t) PyPI (cp311-abi3, cp314t, cp315-abi3.abi3t, sdist) with / async with, PEP 3118 memoryview, to_numpy(copy=False), 33 enum.Enums (Enum | str), Py_MOD_GIL_NOT_USED -Xgil=0 safe Supported
Rust (1.88+) crates.io (capture-system-or-process-audio) #![forbid(unsafe_code)] facade, zero-cost static dispatch, 0-alloc read_into Supported
C++17 RAII GitHub Releases (cspa-ffi + Cspa::cspa_ffi CMake) Header-only cspa.hpp, supports both cspa::Result<T> (-fno-exceptions) and *_or_throw() (/EHsc) Supported
C11 Wire ABI GitHub Releases (cspa_experimental.h + shared lib) struct_size + schema_revision checked records, catch_unwind FFI boundary, 0 Linux NEEDED links Supported
Node.js / TypeScript npm (napi-rs Node-API) Electron V8 Memory Cage safe TypedArrays, AsyncIterable, .toNodeReadable() Planned — Next Release

Side-by-Side: List, Filter & Inspect Available CaptureTargets

Section titled “Side-by-Side: List, Filter & Inspect Available CaptureTargets”

Rather than relying on find_app("Name") when multiple app instances or localized names exist, every SDK lets you enumerate CaptureTargets, filter deterministically, and preview or open the exact plan:

import capture_system_or_process_audio as cspa
catalog = cspa.discover(active_only=False)
for app in catalog.applications:
print(f"{app.name} (pid={app.pid}, active={app.active_audio}, id={app.logical_id})")
selected = [app.with_gain(0.9) for app in catalog.applications if app.active_audio is True][:2]
targets = selected + [cspa.microphone()] if selected else [cspa.microphone(), cspa.default_output()]
plan = cspa.request(targets).inspect()
print("Resolution:", plan.combine_resolution.value, "Streams:", plan.estimated_active_streams)

Per-SDK Developer Handbooks & Ecosystem Guides

Section titled “Per-SDK Developer Handbooks & Ecosystem Guides”