[package]
edition = "2021"
rust-version = "1.85"
name = "cpal"
version = "0.18.0"
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Low-level cross-platform audio I/O library."
documentation = "https://docs.rs/cpal"
readme = "README.md"
keywords = [
"audio",
"sound",
]
license = "Apache-2.0"
repository = "https://github.com/RustAudio/cpal"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"x86_64-apple-darwin",
"aarch64-apple-darwin",
"aarch64-apple-ios",
"wasm32-unknown-unknown",
"aarch64-linux-android",
"x86_64-unknown-freebsd",
"x86_64-unknown-netbsd",
"x86_64-unknown-dragonfly",
]
[badges.maintenance]
status = "actively-developed"
[features]
asio = [
"dep:asio-sys",
"dep:num-traits",
]
audioworklet = [
"wasm-bindgen",
"web-sys/Blob",
"web-sys/BlobPropertyBag",
"web-sys/Url",
"web-sys/AudioWorklet",
"web-sys/AudioWorkletNode",
"web-sys/AudioWorkletNodeOptions",
]
custom = []
default = []
jack = ["dep:jack"]
pipewire = ["dep:pipewire"]
pulseaudio = [
"dep:pulseaudio",
"dep:futures",
]
realtime = [
"dep:audio_thread_priority",
"dep:alsa-sys",
]
realtime-dbus = [
"realtime",
"audio_thread_priority/with_dbus",
]
wasm-bindgen = [
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
]
[lib]
name = "cpal"
path = "src/lib.rs"
[[example]]
name = "beep"
path = "examples/beep.rs"
[[example]]
name = "custom"
path = "examples/custom.rs"
[[example]]
name = "enumerate"
path = "examples/enumerate.rs"
[[example]]
name = "feedback"
path = "examples/feedback.rs"
[[example]]
name = "record_wav"
path = "examples/record_wav.rs"
[[example]]
name = "synth_tones"
path = "examples/synth_tones.rs"
[dependencies.dasp_sample]
version = "0.11"
[dev-dependencies.anyhow]
version = "1.0"
[dev-dependencies.clap]
version = ">=4.6, <5"
features = ["derive"]
[dev-dependencies.hound]
version = "3.5"
[dev-dependencies.ringbuf]
version = "0.4"
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.js-sys]
version = "0.3"
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.wasm-bindgen]
version = "0.2"
optional = true
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.wasm-bindgen-futures]
version = "0.4"
optional = true
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies.web-sys]
version = "0.3"
features = [
"AudioContext",
"AudioContextOptions",
"AudioBuffer",
"AudioBufferSourceNode",
"AudioNode",
"AudioDestinationNode",
"Window",
"AudioContextState",
]
[target.'cfg(any(target_os = "ios", target_os = "tvos"))'.dependencies.block2]
version = "0.6"
[target.'cfg(any(target_os = "ios", target_os = "tvos"))'.dependencies.objc2-avf-audio]
version = "0.3"
features = [
"std",
"AVAudioSession",
"AVAudioSessionTypes",
]
default-features = false
[target.'cfg(any(target_os = "ios", target_os = "tvos"))'.dependencies.objc2-foundation]
version = "0.3"
features = [
"block2",
"NSDictionary",
"NSNotification",
"NSOperation",
]
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.alsa]
version = "0.11"
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.alsa-sys]
version = "0.4"
optional = true
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.audio_thread_priority]
version = "0.35"
optional = true
default-features = false
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.futures]
version = "0.3"
optional = true
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.jack]
version = "0.13.5"
optional = true
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.libc]
version = "0.2"
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.pipewire]
version = "0.10"
features = ["v0_3_53"]
optional = true
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies.pulseaudio]
version = "0.3"
optional = true
[target.'cfg(target_os = "android")'.dependencies.audio_thread_priority]
version = "0.35"
optional = true
default-features = false
[target.'cfg(target_os = "android")'.dependencies.jni]
version = "0.22"
[target.'cfg(target_os = "android")'.dependencies.libc]
version = "0.2"
[target.'cfg(target_os = "android")'.dependencies.ndk]
version = "0.9"
features = [
"audio",
"api-level-26",
]
default-features = false
[target.'cfg(target_os = "android")'.dependencies.ndk-context]
version = "0.1"
[target.'cfg(target_os = "android")'.dependencies.num-derive]
version = "0.4"
[target.'cfg(target_os = "android")'.dependencies.num-traits]
version = "0.2"
[target.'cfg(target_os = "macos")'.dependencies.jack]
version = "0.13.5"
optional = true
[target.'cfg(target_os = "windows")'.dependencies.asio-sys]
version = "0.3.0"
optional = true
[target.'cfg(target_os = "windows")'.dependencies.audio_thread_priority]
version = "0.35"
optional = true
default-features = false
[target.'cfg(target_os = "windows")'.dependencies.jack]
version = "0.13.5"
optional = true
[target.'cfg(target_os = "windows")'.dependencies.num-traits]
version = "0.2"
optional = true
[target.'cfg(target_os = "windows")'.dependencies.windows]
version = ">=0.61, <=0.62"
features = [
"Win32_Media",
"Win32_Media_Audio",
"Win32_Foundation",
"Win32_Devices_Properties",
"Win32_Media_KernelStreaming",
"Win32_System_Com_StructuredStorage",
"Win32_System_Threading",
"Win32_System_Performance",
"Win32_Security",
"Win32_System_SystemServices",
"Win32_System_Variant",
"Win32_Media_Multimedia",
"Win32_UI_Shell_PropertiesSystem",
]
[target.'cfg(target_os = "windows")'.dependencies.windows-core]
version = ">=0.61, <=0.62"
[target.'cfg(target_vendor = "apple")'.dependencies.coreaudio-rs]
version = "0.14.2"
features = [
"core_audio",
"audio_toolbox",
]
default-features = false
[target.'cfg(target_vendor = "apple")'.dependencies.mach2]
version = "0.6"
[target.'cfg(target_vendor = "apple")'.dependencies.objc2]
version = "0.6"
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-audio-toolbox]
version = "0.3"
features = [
"std",
"AUComponent",
"AudioUnitProperties",
]
default-features = false
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-core-audio]
version = "0.3"
features = [
"std",
"AudioHardware",
"AudioHardwareDeprecated",
"objc2",
"objc2-foundation",
]
default-features = false
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-core-audio-types]
version = "0.3"
features = [
"std",
"CoreAudioBaseTypes",
]
default-features = false
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-core-foundation]
version = "0.3"
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-foundation]
version = "0.3"
features = [
"std",
"NSArray",
"NSString",
"NSValue",
]
default-features = false