Crates.io | bevy_rustysynth |
lib.rs | bevy_rustysynth |
version | |
source | src |
created_at | 2024-09-09 23:14:16.864688 |
updated_at | 2024-12-09 20:42:30.576662 |
description | A plugin which adds MIDI file and soundfont audio support to the bevy engine via rustysynth. |
homepage | |
repository | https://git.exvacuum.dev/bevy_rustysynth |
max_upload_size | |
id | 1369852 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A plugin which adds MIDI file and soundfont audio support to the bevy engine via rustysynth.
Crate Version | Bevy Version |
---|---|
0.1-0.2 | 0.14 |
[dependencies]
bevy_rustysynth = "0.2"
[dependencies.bevy_rustysynth]
git = "https://github.com/exvacuum/bevy_rustysynth.git"
In main.rs
:
use bevy::prelude::*;
use bevy_rustysynth::*;
fn main() {
App::new()
.add_plugins((
DefaultPlugins,
RustySynthPlugin {
soundfont: // Bring your own soundfont or enable the "hl4mgm" feature to use a terrible 4MB default
}
))
.run();
}
Then you can load and play a MIDI like any other audio file:
let midi_handle = asset_server.load::<MidiAudio>("example.mid");
commands.spawn(AudioSourceBundle {
source: midi_handle,
..Default::default()
});
This crate is licensed under your choice of 0BSD, Apache-2.0, or MIT license.