-
Notifications
You must be signed in to change notification settings - Fork 535
Expand file tree
/
Copy pathCargo.toml
More file actions
279 lines (250 loc) · 8.29 KB
/
Copy pathCargo.toml
File metadata and controls
279 lines (250 loc) · 8.29 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
[package]
name = "cpal"
version = "0.19.0"
description = "Low-level cross-platform audio I/O library."
repository = "https://github.com/RustAudio/cpal"
documentation = "https://docs.rs/cpal"
license = "Apache-2.0"
keywords = ["audio", "sound", "playback", "recording", "cross-platform"]
categories = ["multimedia::audio"]
edition = "2024"
rust-version = "1.85"
[badges]
maintenance = { status = "actively-developed" }
[features]
default = []
# Real-time audio thread scheduling
# Applies platform-specific real-time scheduling and performance modes to audio threads.
# Requires: (Linux) `CAP_SYS_NICE`, root, or `rtprio` granted via `limits.conf` or systemd
# Platform: Android, Linux, Windows (see `realtime-dbus` for rtkit on Linux)
realtime = ["dep:audio_thread_priority", "dep:alsa-sys"]
# Enables `realtime` and adds D-Bus/rtkit support, for RT scheduling on Linux desktop systems
# Requires: D-Bus development libraries (libdbus-1-dev or equivalent)
# Platform: Linux
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 = [
"dep:futures-channel",
"dep:futures-util",
"wasm-bindgen",
"web-sys/Blob",
"web-sys/BlobPropertyBag",
"web-sys/Url",
"web-sys/AudioWorklet",
"web-sys/AudioWorkletNode",
"web-sys/AudioWorkletNodeOptions",
"web-sys/ChannelCountMode",
"web-sys/Event",
]
# 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-executor",
"dep:futures-util",
"dep:portable-atomic",
]
# 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",
"dep:futures-channel",
"dep:futures-util",
"web-sys/Navigator",
"web-sys/MediaDevices",
"web-sys/MediaStream",
"web-sys/MediaStreamConstraints",
"web-sys/MediaStreamTrack",
"web-sys/MediaStreamAudioSourceNode",
"web-sys/ScriptProcessorNode",
"web-sys/AudioProcessingEvent",
"web-sys/GainNode",
"web-sys/AudioParam",
]
[dependencies]
dasp_sample = "0.11"
[dev-dependencies]
anyhow = "1.0"
hound = "3.5"
ringbuf = "0.4"
clap = { version = "4.6", features = ["derive"] }
# `windows` and `windows-core` must be the same minor version.
[target.'cfg(target_os = "windows")'.dependencies]
windows-core = "0.62"
windows = { version = "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.36", optional = true, default-features = false }
asio-sys = { version = "0.5.0", path = "asio-sys", optional = true }
num-traits = { version = "0.2", optional = true }
jack = { version = "0.13.5", optional = true }
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"))'.dependencies]
alsa = "0.12.1"
alsa-sys = { version = "0.6.1", optional = true }
libc = "0.2"
audio_thread_priority = { version = "0.36", optional = true, default-features = false }
jack = { version = "0.13.5", optional = true }
pulseaudio = { version = "0.3", optional = true }
futures-executor = { version = "0.3", optional = true }
futures-util = { version = "0.3", default-features = false, optional = true, features = [
"alloc",
] }
pipewire = { version = "0.10", optional = true, features = ["v0_3_53"] }
[target.'cfg(all(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd"), not(target_has_atomic = "64")))'.dependencies]
# 64-bit atomics on targets without native support (e.g. mips, powerpc, riscv32).
portable-atomic = { version = "1", optional = true }
[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.1" }
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.5", optional = true }
[target.'cfg(any(target_os = "ios", target_os = "tvos", target_os = "visionos"))'.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 }
futures-channel = { version = "0.3", optional = true }
futures-util = { version = "0.3", default-features = false, optional = true, features = [
"alloc",
] }
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.36", optional = true, default-features = false }
ndk = { version = "0.9", default-features = false, features = [
"audio",
"api-level-26",
] }
ndk-context = "0.1"
jni = "0.22"
libc = "0.2"
num-derive = "0.4"
num-traits = "0.2"
[[example]]
name = "beep"
[[example]]
name = "enumerate"
[[example]]
name = "duplex"
[[example]]
name = "feedback"
[[example]]
name = "record_wav"
[[example]]
name = "synth_tones"
[[example]]
name = "custom"
required-features = ["custom"]
[package.metadata.docs.rs]
# The docs.rs build environment does not have all the dependencies for all features
features = [
"asio",
"audioworklet",
"custom",
"jack",
"pulseaudio",
"realtime",
"realtime-dbus",
"wasm-bindgen",
]
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",
]