-
Notifications
You must be signed in to change notification settings - Fork 506
Expand file tree
/
Copy pathCargo.toml
More file actions
229 lines (204 loc) · 7.34 KB
/
Cargo.toml
File metadata and controls
229 lines (204 loc) · 7.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
[package]
name = "cpal"
version = "0.18.0"
description = "Low-level cross-platform audio I/O library in pure Rust."
repository = "https://github.com/RustAudio/cpal"
documentation = "https://docs.rs/cpal"
license = "Apache-2.0"
keywords = ["audio", "sound"]
edition = "2021"
rust-version = "1.78"
[features]
default = ["realtime-dbus"]
# Real-time audio thread scheduling
# Promotes audio callback threads to real-time or high-priority scheduling for lower latency
# Requires: (Linux/BSD) `rtprio` granted in `limits.conf` (e.g. `@audio - rtprio 95`)
# Platform: Linux, DragonFly BSD, FreeBSD, NetBSD, Windows, Android
realtime = ["dep:audio_thread_priority"]
# D-Bus/rtkit support on top of `realtime` for RT scheduling on Linux/BSD desktop systems
# Requires: D-Bus development libraries (libdbus-1-dev or equivalent)
# Platform: Linux, DragonFly BSD, FreeBSD, NetBSD (D-Bus/rtkit is a no-op elsewhere; thread
# priority promotion from `realtime` still applies on Windows and Android)
realtime-dbus = ["realtime", "audio_thread_priority/with_dbus"]
# 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
asio = [
"dep:asio-sys",
"dep:num-traits",
]
# 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)
audioworklet = [
"wasm-bindgen",
"web-sys/Blob",
"web-sys/BlobPropertyBag",
"web-sys/Url",
"web-sys/AudioWorklet",
"web-sys/AudioWorkletNode",
"web-sys/AudioWorkletNodeOptions",
]
# Support for user-defined custom hosts, devices, and streams
# See examples/custom.rs for usage
# Platform: All platforms
custom = []
# 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
jack = ["dep:jack"]
# PipeWire backend
# Provides audio I/O on Linux and some BSDs via the PipeWire multimedia server
# Requires: PipeWire server and client libraries installed on the system
# Platform: Linux, DragonFly BSD, FreeBSD, NetBSD
pipewire = ["dep:pipewire"]
# PulseAudio backend
# Provides audio I/O support on Linux and some BSDs using the PulseAudio sound server
# Requires: PulseAudio server and client libraries installed on the system
# Platform: Linux, DragonFly BSD, FreeBSD, NetBSD
pulseaudio = ["dep:pulseaudio", "dep:futures"]
# 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
wasm-bindgen = ["dep:wasm-bindgen", "dep:wasm-bindgen-futures"]
[dependencies]
dasp_sample = "0.11"
[dev-dependencies]
anyhow = "1.0"
hound = "3.5"
ringbuf = "0.4"
clap = { version = ">=4.0, <=4.5.57", features = ["derive"] }
# Support a range of versions in order to avoid duplication of this crate. Make sure to test all
# versions when bumping to a new release, and only increase the minimum when absolutely necessary.
# windows 0.61 removed the `implement` feature flag, so #[windows::core::implement] works
# unconditionally from 0.61 onward. Keep the upper bound in sync with the CI matrix below.
[target.'cfg(target_os = "windows")'.dependencies]
windows-core = { version = ">=0.61, <=0.62" }
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",
] }
audio_thread_priority = { version = "0.35", optional = true, default-features = false }
asio-sys = { version = "0.3.0", path = "asio-sys", optional = true }
num-traits = { version = "0.2", optional = true }
jack = { version = "0.13", optional = true }
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies]
alsa = "0.11"
libc = "0.2"
audio_thread_priority = { version = "0.35", optional = true, default-features = false }
jack = { version = "0.13", optional = true }
pulseaudio = { version = "0.3", optional = true }
futures = { version = "0.3", optional = true }
pipewire = { version = "0.9", optional = true, features = ["v0_3_53"] }
[target.'cfg(target_vendor = "apple")'.dependencies]
mach2 = "0.6"
coreaudio-rs = { version = "0.14.2", default-features = false, features = [
"core_audio",
"audio_toolbox",
] }
objc2-core-audio = { version = "0.3", default-features = false, features = [
"std",
"AudioHardware",
"AudioHardwareDeprecated",
"objc2",
"objc2-foundation",
] }
objc2-audio-toolbox = { version = "0.3", default-features = false, features = [
"std",
"AUComponent",
"AudioUnitProperties",
] }
objc2-core-audio-types = { version = "0.3", default-features = false, features = [
"std",
"CoreAudioBaseTypes",
] }
objc2-core-foundation = { version = "0.3" }
objc2-foundation = { version = "0.3", default-features = false, features = [
"std",
"NSArray",
"NSString",
"NSValue",
] }
objc2 = { version = "0.6" }
[target.'cfg(target_os = "macos")'.dependencies]
jack = { version = "0.13", optional = true }
[target.'cfg(any(target_os = "ios", target_os = "tvos"))'.dependencies]
block2 = "0.6"
objc2-foundation = { version = "0.3", features = [
"block2",
"NSDictionary",
"NSNotification",
"NSOperation",
] }
objc2-avf-audio = { version = "0.3", default-features = false, features = [
"std",
"AVAudioSession",
"AVAudioSessionTypes",
] }
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
js-sys = { version = "0.3" }
web-sys = { version = "0.3", features = [
"AudioContext",
"AudioContextOptions",
"AudioBuffer",
"AudioBufferSourceNode",
"AudioNode",
"AudioDestinationNode",
"Window",
"AudioContextState",
] }
[target.'cfg(target_os = "android")'.dependencies]
audio_thread_priority = { version = "0.35", optional = true, default-features = false }
ndk = { version = "0.9", default-features = false, features = [
"audio",
"api-level-26",
] }
ndk-context = "0.1"
jni = "0.21"
libc = "0.2"
num-derive = "0.4"
num-traits = "0.2"
[[example]]
name = "beep"
[[example]]
name = "enumerate"
[[example]]
name = "feedback"
[[example]]
name = "record_wav"
[[example]]
name = "synth_tones"
[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",
]