-
Notifications
You must be signed in to change notification settings - Fork 301
Expand file tree
/
Copy pathCargo.toml
More file actions
275 lines (225 loc) · 6.88 KB
/
Cargo.toml
File metadata and controls
275 lines (225 loc) · 6.88 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
[package]
name = "rodio"
version = "0.21.1"
license = "MIT OR Apache-2.0"
description = "Audio playback library"
keywords = ["audio", "playback", "gamedev"]
repository = "https://github.com/RustAudio/rodio"
documentation = "https://docs.rs/rodio"
exclude = ["assets/**", "tests/**"]
edition = "2021"
rust-version = "1.87"
[features]
default = [
"playback",
"recording",
"dither",
"rubato-fft",
"simd",
"flac",
"mp3",
"mp4",
"vorbis",
"wav",
]
# Core functionality features
#
# Enable audio playback
playback = ["dep:cpal"]
# Enable audio recording
recording = ["dep:cpal", "dep:rtrb"]
# Enable writing audio to WAV files
wav_output = ["dep:hound"]
# Enable structured observability and instrumentation
tracing = ["dep:tracing"]
# Experimental features using atomic floating-point operations
experimental = ["dep:atomic_float"]
# Perform calculations with 64-bit floats (instead of 32)
64bit = []
# Enable SIMD optimizations
simd = ["symphonia/opt-simd"]
# Audio generation features
#
# Enable audio dithering
dither = ["noise"]
# Enable noise generation (white noise, pink noise, etc.)
noise = ["rand", "rand_distr"]
# Platform-specific features
#
# Enable WebAssembly support for web browsers
wasm-bindgen = ["cpal/wasm-bindgen"]
# To decode an audio source with Rodio, you need to enable the appropriate features for *both* the
# demuxer and the decoder.
#
# Audio files consist of a demuxer (container format) and a decoder (audio codec), for example:
# - .mp3 is an MPEG-1 Audio Layer III file, which is a container format that uses the MP3 codec
# - .mp4 is an MPEG-4 container, typically (but not always) with an AAC-encoded audio stream
# - .ogg is an Ogg container with a Vorbis-encoded audio stream
flac = ["symphonia-flac"]
mp3 = ["symphonia-mp3"]
mp4 = ["symphonia-isomp4", "symphonia-aac"]
vorbis = ["symphonia-ogg", "symphonia-vorbis"]
wav = ["symphonia-wav", "symphonia-pcm"]
# Aliases
aac = ["mp4"]
ogg = ["vorbis"]
# The following features are combinations of demuxers and decoders provided by Symphonia.
# Unless you are developing a generic audio player, this is probably overkill.
symphonia-all = ["symphonia/all-formats", "symphonia/all-codecs"]
# Combination of decoder and native demuxer provided by Symphonia
symphonia-flac = ["symphonia/flac"]
symphonia-mp1 = ["symphonia/mp1"] # MPEG-1 Audio Layer I
symphonia-mp2 = ["symphonia/mp2"] # MPEG-1 Audio Layer II
symphonia-mp3 = ["symphonia/mp3"] # MPEG-1 Audio Layer III
# Combination of all MPEG-1 audio demuxers and decoders provided by Symphonia
symphonia-mpa = ["symphonia/mpa"]
# Formats (demuxers) provided by Symphonia
symphonia-aiff = ["symphonia/aiff"]
symphonia-caf = ["symphonia/caf"]
symphonia-isomp4 = ["symphonia/isomp4"]
symphonia-mkv = ["symphonia/mkv"]
symphonia-ogg = ["symphonia/ogg"]
# Codecs (decoders) provided by Symphonia
symphonia-aac = ["symphonia/aac"]
symphonia-adpcm = ["symphonia/adpcm"]
symphonia-alac = ["symphonia/alac"]
symphonia-pcm = ["symphonia/pcm"]
symphonia-vorbis = ["symphonia/vorbis"]
symphonia-wav = ["symphonia/wav"]
# Enable SIMD optimisations for Symphonia
symphonia-simd = ["symphonia/opt-simd"]
# Resampling features
#
# Enable FFT-based synchronous resampling as an optimization for fixed-ratio conversions. When
# enabled, conversions between standard sample rates (e.g., 48 kHz and 96 kHz, as well as 44.1 kHz
# and 48 kHz) that simplify to small integer ratios automatically use FFT processing for faster
# processing at the cost of a larger binary.
rubato-fft = ["rubato/fft_resampler"]
# Alternative decoders and demuxers
claxon = ["dep:claxon"] # FLAC
hound = ["dep:hound"] # WAV
lewton = ["dep:lewton"] # Ogg Vorbis
minimp3 = ["dep:minimp3_fixed"] # MP3
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
cpal = { version = "0.17.0", optional = true }
dasp_sample = "0.11.0"
claxon = { version = "0.4.2", optional = true }
hound = { version = "3.5", optional = true }
lewton = { version = "0.10", optional = true }
minimp3_fixed = { version = "0.5.4", optional = true }
symphonia = { version = "0.5.4", optional = true, default-features = false }
crossbeam-channel = { version = "0.5.15", optional = true }
thiserror = "2"
rand = { version = "0.9", features = ["small_rng"], optional = true }
rand_distr = { version = "0.5", optional = true }
tracing = { version = "0.1.40", optional = true }
atomic_float = { version = "1.1.0", optional = true }
rtrb = { version = "0.3.2", optional = true }
# Rubato resampling
rubato = { version = "1.0", default-features = false }
audioadapter-buffers = "2.0"
num-rational = "0.4.2"
[dev-dependencies]
quickcheck = "1"
rstest = "0.25"
rstest_reuse = "0.7"
approx = "0.5.1"
divan = "0.1.14"
inquire = "0.7.5"
[[bench]]
name = "effects"
harness = false
required-features = ["wav"]
[[bench]]
name = "conversions"
harness = false
required-features = ["wav"]
[[bench]]
name = "resampler"
harness = false
required-features = ["wav"]
[[bench]]
name = "pipeline"
harness = false
required-features = ["wav"]
[[example]]
name = "automatic_gain_control"
required-features = ["playback", "flac"]
[[example]]
name = "basic"
required-features = ["playback", "vorbis"]
[[example]]
name = "callback_on_end"
required-features = ["playback", "wav"]
[[example]]
name = "custom_config"
required-features = ["playback", "wav"]
[[example]]
name = "distortion"
required-features = ["playback"]
[[example]]
name = "distortion_mp3"
required-features = ["playback", "mp3"]
[[example]]
name = "distortion_wav"
required-features = ["playback", "wav"]
[[example]]
name = "distortion_wav_alternate"
required-features = ["playback", "wav"]
[[example]]
name = "error_callback"
required-features = ["playback"]
[[example]]
name = "into_file"
required-features = ["mp3", "wav_output"]
[[example]]
name = "limit_wav"
required-features = ["playback", "wav"]
[[example]]
name = "low_pass"
required-features = ["playback", "wav"]
[[example]]
name = "microphone"
required-features = ["playback", "recording", "wav_output"]
[[example]]
name = "mix_multiple_sources"
required-features = ["playback"]
[[example]]
name = "music_flac"
required-features = ["playback", "flac"]
[[example]]
name = "music_m4a"
required-features = ["playback", "mp4"]
[[example]]
name = "music_mp3"
required-features = ["playback", "mp3"]
[[example]]
name = "music_ogg"
required-features = ["playback", "vorbis"]
[[example]]
name = "music_wav"
required-features = ["playback", "wav"]
[[example]]
name = "noise_generator"
required-features = ["playback", "noise"]
[[example]]
name = "resample"
required-features = ["playback"]
[[example]]
name = "reverb"
required-features = ["playback", "vorbis"]
[[example]]
name = "seek_mp3"
required-features = ["playback", "mp3"]
[[example]]
name = "signal_generator"
required-features = ["playback"]
[[example]]
name = "spatial"
required-features = ["playback", "vorbis"]
[[example]]
name = "stereo"
required-features = ["playback", "vorbis"]