-
Notifications
You must be signed in to change notification settings - Fork 300
Expand file tree
/
Copy pathCargo.toml
More file actions
274 lines (223 loc) · 7.04 KB
/
Cargo.toml
File metadata and controls
274 lines (223 loc) · 7.04 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
[package]
name = "rodio"
version = "0.22.2"
license = "MIT OR Apache-2.0"
description = "Audio playback and recording library"
keywords = ["audio", "playback", "recording", "gamedev"]
repository = "https://github.com/RustAudio/rodio"
documentation = "https://docs.rs/rodio"
exclude = ["assets/**", "tests/**"]
edition = "2021"
rust-version = "1.89"
[features]
# Default feature set provides audio playback and common format support
default = [
"playback",
"recording",
"flac",
"mp3",
"mp4",
"vorbis",
"wav",
"dither",
]
# 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 all calculations with 64-bit floats (instead of 32)
64bit = []
# 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"]
# Base symphonia feature (doesn't enable any codecs)
# A feature with this name is created implicitly due to other features that reference `symphonia/xxx`
# but we need to make it explicit here so other features can reference it.
symphonia = ["dep:symphonia"]
# 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
#
# A reasonable set of audio demuxers and decoders for most applications.
flac = ["symphonia-flac"]
mp3 = ["symphonia-mp3"]
mp4 = ["symphonia-isomp4", "symphonia-aac"]
vorbis = ["symphonia-ogg", "symphonia-vorbis"]
wav = ["symphonia-wav", "symphonia-pcm"]
# 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"]
# libopus adapter for Symphonia
symphonia-libopus = ["symphonia", "dep:symphonia-adapter-libopus"]
# Alternative decoders and demuxers
claxon = ["dep:claxon"] # FLAC
hound = ["dep:hound"] # WAV
minimp3 = ["dep:minimp3_fixed"] # MP3
lewton = ["dep:lewton"] # Ogg Vorbis
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
cargo-args = ["-Zunstable-options"]
[dependencies]
cpal = { git = "https://github.com/RustAudio/cpal", optional = true }
dasp_sample = "0.11"
claxon = { version = "0.4", 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.5", optional = true, default-features = false }
crossbeam-channel = { version = "0.5.15", optional = true }
thiserror = "2"
rand = { version = "0.10", optional = true }
rand_distr = { version = "0.6", optional = true }
tracing = { version = "0.1.40", optional = true }
atomic_float = { version = "1.1.0", optional = true }
rtrb = { version = "0.3.2", optional = true }
num-rational = "0.4.2"
symphonia-adapter-libopus = { version = "0.2", optional = true }
[dev-dependencies]
quickcheck = "1"
rstest = "0.26"
rstest_reuse = "0.7"
approx = "0.5.1"
divan = "0.1.14"
inquire = "0.9.3"
symphonia-adapter-fdk-aac = "0.1"
[[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 = "music_opus"
required-features = ["playback", "symphonia-libopus"]
[[example]]
name = "noise_generator"
required-features = ["playback", "noise"]
[[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"]
[[example]]
name = "third_party_codec"
required-features = ["playback", "symphonia", "symphonia-isomp4"]