mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 05:03:47 +00:00
aeba9faf04
# 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>
14 lines
357 B
Rust
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);
|
|
}
|