mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
16 lines
416 B
Rust
16 lines
416 B
Rust
use bevy::prelude::*;
|
|
|
|
/// This example illustrates how to load and play an audio file
|
|
fn main() {
|
|
App::build()
|
|
.add_default_plugins()
|
|
.add_startup_system(setup.system())
|
|
.run();
|
|
}
|
|
|
|
fn setup(asset_server: Res<AssetServer>, audio_output: Res<AudioOutput>) {
|
|
let music = asset_server
|
|
.load("assets/sounds/Windless Slopes.mp3")
|
|
.unwrap();
|
|
audio_output.play(music);
|
|
}
|