Expand description
§Game Music Emu Rust
This crate contains Rust bindings for Game Music Emu. It is pretty barebones at the moment and does not cover everything, but eventually it will have bindings for most of the functions in gme.h.
§Conditional Compilation
Just like the C++ version of Game Music Emu, you can choose which emulators are included by adding features to your Cargo.toml
.
For example, if you only want to use Nintendo and Game Boy emulators, you’d write:
game-music-emu = { version = "0.2", default-features = false, features = ["gbs", "nsf"] }
See Cargo.toml for all available features. The build logic is in build.rs. You can call gme::type_list()
at runtime for a list of emulators you compiled with.
§Example Usage
use game_music_emu::{EmuType, GameMusicEmu};
let emu = GameMusicEmu::new(EmuType::Nsf, 44100);
emu.load_file("assets/test.nsf")?;
emu.start_track(0);
There is also an example that plays a song.
Structs§
- Provides a wrapper around native functions that take an
EmuHandle
- Contains an error message passed by Game Music Emu
Enums§
- All supported emulator types
- Either an IO error or a GME error
Functions§
- Determine likely
EmuType
based on first four bytes of file. - Returns all of the supported
EmuTypes
. This is based on the features the crate is compiled with.