You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
- Closes#19672
## Solution
- Updated both `cpal` and `rodio` to their latest versions.
- Updated code to address `rodio`'s breaking changes.
- Reworked audio related feature flags. NOTE: `symphonia` will only be
the default backend for formats with no alternative fallback.
- Added `audio-all-formats` feature collection to easily enable all the
available audio formats using their default backends.
- Replaced `aarch64-apple-ios-sim` target with
`arm64-apple-ios-simulator`.
## Testing
- Tested audio related examples.
- CI checks passing.
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Parrett <robparrett@gmail.com>
# For KTX2 Zstandard decompression using [zstd](https://crates.io/crates/zstd). This is a faster backend, but uses unsafe C bindings. For the safe option, stick to the default backend with "zstd_rust".
498
500
zstd_c = ["bevy_internal/zstd_c"]
499
501
500
-
# FLAC audio format support
501
-
flac = ["bevy_internal/flac"]
502
-
503
-
# MP3 audio format support
504
-
mp3 = ["bevy_internal/mp3"]
502
+
# FLAC audio format support (through `symphonia`)
503
+
symphonia-flac = ["bevy_internal/symphonia-flac"]
505
504
506
-
# OGG/VORBIS audio format support
507
-
vorbis = ["bevy_internal/vorbis"]
505
+
# OGG/VORBIS audio format support (through `symphonia`)
`rodio` was updated to `0.22` and `cpal` to `0.17`. The following sections will guide you through the necessary changes to ensure compatibility.
7
+
8
+
## Audio Feature Flags
9
+
10
+
Audio format related features were reworked with this update.
11
+
12
+
By default, Bevy will enable the `vorbis` feature, which supports OGG/VORBIS files through `lewton`.
13
+
14
+
If you are not using Bevy's default features, here's a list you can use for reference:
15
+
16
+
-`vorbis`: OGG/VORBIS audio format support (through `lewton`).
17
+
-`wav`: WAV audio format support (through `hound`).
18
+
-`mp3`: MP3 audio format support (through `symphonia`).
19
+
-`mp4`: MP4 audio format support (through `symphonia`). It also enables AAC support.
20
+
-`flac`: FLAC audio format support (through `claxon`).
21
+
-`aac`: AAC audio format support (through `symphonia`).
22
+
23
+
There are also specific `symphonia` backend flags you can use for certain formats instead of the default flags:
24
+
25
+
-`symphonia-flac`
26
+
-`symphonia-vorbis`
27
+
-`symphonia-wav`
28
+
29
+
Notice that OGG/VORBIS support through `symphonia` is currently subject to issues with buffering, reverb, looping and spatial audio. Check the following issues/PRs for additional context:
30
+
31
+
-<https://github.com/RustAudio/rodio/issues/775>
32
+
-<https://github.com/RustAudio/rodio/pull/786>
33
+
34
+
The `audio-all-formats` feature collection was added for convenience. It will enable `bevy_audio` and all the available audio formats through their default backends.
35
+
36
+
## Audio Traits
37
+
38
+
`type DecoderItem` was removed from the `Decodable` trait. Now `rodio::Sample` is an alias for `f32`.
39
+
40
+
## Android Related Features
41
+
42
+
The `android_shared_stdcxx` feature was removed, as `cpal`'s `oboe-shared-stdcxx` feature was also removed in favor of Android NDK audio APIs.
43
+
44
+
Keep in mind that if you are using `bevy_audio` the minimum supported Android API version is now 26 (Android 8/Oreo).
@@ -80,22 +81,16 @@ impl AssetLoader for AudioLoader {
80
81
/// This trait is implemented for [`AudioSource`].
81
82
/// Check the example [`decodable`](https://github.com/bevyengine/bevy/blob/latest/examples/audio/decodable.rs) for how to implement this trait on a custom type.
82
83
pubtraitDecodable:Send + Sync + 'static{
83
-
/// The type of the audio samples.
84
-
/// Usually a [`u16`], [`i16`] or [`f32`], as those implement [`rodio::Sample`].
85
-
/// Other types can implement the [`rodio::Sample`] trait as well.
86
-
typeDecoderItem: rodio::Sample + Send + Sync;
87
-
88
84
/// The type of the iterator of the audio samples,
89
-
/// which iterates over samples of type [`Self::DecoderItem`].
85
+
/// which iterates over samples of type [`rodio::Sample`].
90
86
/// Must be a [`rodio::Source`] so that it can provide information on the audio it is iterating over.
0 commit comments