Cargo Features

CPAL has no features set by default.

[dependencies]
cpal = { version = "0.17.3", features = ["asio", "jack", "wasm-bindgen", "audioworklet", "custom", "audio_thread_priority"] }
asio

ASIO backend for Windows
Provides low-latency audio I/O by bypassing the Windows audio stack Requires: ASIO drivers and LLVM/Clang for build-time bindings See README for detailed setup instructions

Enables asio-sys and num-traits

jack

JACK Audio Connection Kit backend
Provides low-latency connections between applications and audio hardware Requires: JACK server and client libraries installed on the system Platform: Linux, DragonFly BSD, FreeBSD, NetBSD, macOS, Windows Note: JACK must be installed separately on all platforms

Enables jack

wasm-bindgen audioworklet?

WebAssembly backend using wasm-bindgen
Enables the Web Audio API backend for browser-based audio Required for any WebAssembly audio support
Platform: WebAssembly (wasm32-unknown-unknown)
Note: This is typically enabled automatically when targeting wasm32

Enables wasm-bindgen and wasm-bindgen-futures

audioworklet = wasm-bindgen

Audio Worklet backend for WebAssembly
Provides lower-latency web audio processing compared to default Web Audio API Requires: Build with atomics support and Cross-Origin headers for SharedArrayBuffer Platform: WebAssembly (wasm32-unknown-unknown)

Enables AudioWorklet, AudioWorkletNode, AudioWorkletNodeOptions, Blob, BlobPropertyBag and Url of web-sys

custom

Support for user-defined custom hosts, devices, and streams Allows integration with audio systems not natively supported by CPAL See examples/custom.rs for usage
Platform: All platforms

Features from optional dependencies

audio_thread_priority win linux dragonfly freebsd netbsd implicit feature

Enables audio_thread_priority

audio_thread_priority:

Bump a thread to real-time priority, for audio work, on Linux, Android, Windows and macOS