bevy/examples/audio/audio.rs
François aeba9faf04 use ogg by default instead of mp3 (#3421)
# 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>
2021-12-23 19:19:15 +00:00

14 lines
357 B
Rust

use bevy::prelude::*;
/// This example illustrates how to load and play an audio file
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.run();
}
fn setup(asset_server: Res<AssetServer>, audio: Res<Audio>) {
let music = asset_server.load("sounds/Windless Slopes.ogg");
audio.play(music);
}