1[package]
2name = "cpal"
3version = "0.15.3"
4description = "Low-level cross-platform audio I/O library in pure Rust."
5repository = "https://github.com/rustaudio/cpal"
6documentation = "https://docs.rs/cpal"
7license = "Apache-2.0"
8keywords = ["audio", "sound"]
9edition = "2021"
10rust-version = "1.70"
11
12[features]
13asio = ["asio-sys", "num-traits"] # Only available on Windows. See README for setup instructions.
14oboe-shared-stdcxx = ["oboe/shared-stdcxx"] # Only available on Android. See README for what it does.
15
16[dependencies]
17dasp_sample = "0.11"
18
19[dev-dependencies]
20anyhow = "1.0"
21hound = "3.5"
22ringbuf = "0.3"
23clap = { version = "4.0", features = ["derive"] }
24
25[target.'cfg(target_os = "android")'.dev-dependencies]
26ndk-glue = "0.7"
27
28[target.'cfg(target_os = "windows")'.dependencies]
29windows = { version = "0.54.0", features = [
30 "Win32_Media_Audio",
31 "Win32_Foundation",
32 "Win32_Devices_Properties",
33 "Win32_Media_KernelStreaming",
34 "Win32_System_Com_StructuredStorage",
35 "Win32_System_Threading",
36 "Win32_Security",
37 "Win32_System_SystemServices",
38 "Win32_System_Variant",
39 "Win32_Media_Multimedia",
40 "Win32_UI_Shell_PropertiesSystem"
41]}
42asio-sys = { version = "0.2", path = "asio-sys", optional = true }
43num-traits = { version = "0.2.6", optional = true }
44
45[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies]
46alsa = "0.9"
47libc = "0.2"
48jack = { version = "0.11", optional = true }
49
50[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
51core-foundation-sys = "0.8.2" # For linking to CoreFoundation.framework and handling device name `CFString`s.
52mach2 = "0.4" # For access to mach_timebase type.
53
54[target.'cfg(target_os = "macos")'.dependencies]
55coreaudio-rs = { version = "0.11", default-features = false, features = ["audio_unit", "core_audio"] }
56
57[target.'cfg(target_os = "ios")'.dependencies]
58coreaudio-rs = { version = "0.11", default-features = false, features = ["audio_unit", "core_audio", "audio_toolbox"] }
59
60[target.'cfg(target_os = "emscripten")'.dependencies]
61wasm-bindgen = { version = "0.2.89" }
62wasm-bindgen-futures = "0.4.33"
63js-sys = { version = "0.3.35" }
64web-sys = { version = "0.3.35", features = [ "AudioContext", "AudioContextOptions", "AudioBuffer", "AudioBufferSourceNode", "AudioNode", "AudioDestinationNode", "Window", "AudioContextState"] }
65
66[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
67wasm-bindgen = { version = "0.2.58", optional = true }
68js-sys = { version = "0.3.35" }
69web-sys = { version = "0.3.35", features = [ "AudioContext", "AudioContextOptions", "AudioBuffer", "AudioBufferSourceNode", "AudioNode", "AudioDestinationNode", "Window", "AudioContextState"] }
70
71[target.'cfg(target_os = "android")'.dependencies]
72oboe = { version = "0.6", features = [ "java-interface" ] }
73ndk = { version = "0.8", default-features = false }
74ndk-context = "0.1"
75jni = "0.21"
76
77[[example]]
78name = "android"
79path = "examples/android.rs"
80crate-type = ["cdylib"]
81
82[[example]]
83name = "beep"
84
85[[example]]
86name = "enumerate"
87
88[[example]]
89name = "feedback"
90
91[[example]]
92name = "record_wav"
93
94[[example]]
95name = "synth_tones"
96