mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
70d9dfdc48
# Objective Fixes #12900 ## Solution Added comment to example indicating that additional audio formats are supported when the feature is added. --------- Co-authored-by: James Liu <contact@jamessliu.com>
18 lines
510 B
Rust
18 lines
510 B
Rust
//! This example illustrates how to load and play an audio file.
|
|
//! For loading additional audio formats, you can enable the corresponding feature for that audio format.
|
|
|
|
use bevy::prelude::*;
|
|
|
|
fn main() {
|
|
App::new()
|
|
.add_plugins(DefaultPlugins)
|
|
.add_systems(Startup, setup)
|
|
.run();
|
|
}
|
|
|
|
fn setup(asset_server: Res<AssetServer>, mut commands: Commands) {
|
|
commands.spawn(AudioBundle {
|
|
source: asset_server.load("sounds/Windless Slopes.ogg"),
|
|
..default()
|
|
});
|
|
}
|