Skip to content

Commit

Permalink
use ogg by default instead of mp3 (#3421)
Browse files Browse the repository at this point in the history
# Objective

- mp3 feature of rodio has dependencies that are not maintained with security issues
- mp3 feature of rodio doesn't build in wasm
- mp3 feature of rodio uses internal memory allocation that cause rejection from Apple appstore

## Solution

- Use vorbis instead of mp3 by default


Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
  • Loading branch information
mockersf and mockersf committed Dec 23, 2021
1 parent c6d4c63 commit aeba9fa
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ default = [
"render",
"png",
"hdr",
"mp3",
"vorbis",
"x11",
"filesystem_watcher",
]
Expand Down
Binary file removed assets/sounds/Windless Slopes.mp3
Binary file not shown.
Binary file added assets/sounds/Windless Slopes.ogg
Binary file not shown.
2 changes: 0 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ yanked = "deny"
notice = "deny"
ignore = [
"RUSTSEC-2020-0056", # from gilrs v0.8.1 - unmaintained - https://github.com/koute/stdweb/issues/403
"RUSTSEC-2020-0158", # from rodio v0.14.0 - unmaintained - https://github.com/gnzlbg/slice_deque/issues/94
"RUSTSEC-2021-0047", # from rodio v0.14.0 - unsafety - https://github.com/gnzlbg/slice_deque/issues/90
"RUSTSEC-2020-0095", # from crevice dev dependency - unmaintained - https://github.com/johannhof/difference.rs/issues/45
"RUSTSEC-2021-0119", # from rodio 0.14.0 - unsafety - https://github.com/nix-rust/nix/issues/1541
]
Expand Down
4 changes: 2 additions & 2 deletions docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
|render|The render pipeline and all render related plugins.|
|png|PNG picture format support.|
|hdr|[HDR](https://en.wikipedia.org/wiki/High_dynamic_range) support.|
|mp3|MP3 audio format support.|
|vorbis|Ogg Vorbis audio format support.|
|x11|Make GUI applications use X11 protocol. You could enable wayland feature to override this.|
|filesystem_watcher|Enable watching the file system for asset hot reload|

Expand All @@ -30,8 +30,8 @@
|jpeg|JPEG picture format support.|
|bmp|BMP picture format support.|
|flac|FLAC audio format support. It's included in bevy_audio feature.|
|mp3|MP3 audio format support.|
|wav|WAV audio format support.|
|vorbis|Vorbis audio format support.|
|serialize|Enables serialization of `bevy_input` types.|
|wayland|Enable this to use Wayland display server protocol other than X11.|
|subpixel_glyph_atlas|Enable this to cache glyphs using subpixel accuracy. This increases texture memory usage as each position requires a separate sprite in the glyph atlas, but provide more accurate character spacing.|
Expand Down
2 changes: 1 addition & 1 deletion examples/audio/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ fn main() {
}

fn setup(asset_server: Res<AssetServer>, audio: Res<Audio>) {
let music = asset_server.load("sounds/Windless Slopes.mp3");
let music = asset_server.load("sounds/Windless Slopes.ogg");
audio.play(music);
}
2 changes: 1 addition & 1 deletion examples/ios/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bevy = { path = "../../", features = [
"bevy_audio",
"bevy_winit",
"render",
"mp3",
"vorbis",
"x11",
"filesystem_watcher"
], default-features = false}
2 changes: 1 addition & 1 deletion examples/ios/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ fn setup_scene(
}

fn setup_music(asset_server: Res<AssetServer>, audio: Res<Audio>) {
let music = asset_server.load("sounds/Windless Slopes.mp3");
let music = asset_server.load("sounds/Windless Slopes.ogg");
audio.play(music);
}

0 comments on commit aeba9fa

Please sign in to comment.