diff --git a/agb/Cargo.lock b/agb/Cargo.lock index cf91b596..9e3e3347 100644 --- a/agb/Cargo.lock +++ b/agb/Cargo.lock @@ -14,6 +14,7 @@ version = "0.7.0" dependencies = [ "agb_image_converter", "agb_macros", + "agb_sound_converter", "bitflags", ] @@ -39,6 +40,16 @@ dependencies = [ "syn", ] +[[package]] +name = "agb_sound_converter" +version = "0.1.0" +dependencies = [ + "hound", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "autocfg" version = "1.0.1" @@ -105,6 +116,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "hound" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" + [[package]] name = "image" version = "0.23.14" diff --git a/agb/Cargo.toml b/agb/Cargo.toml index 023e2935..d48336f8 100644 --- a/agb/Cargo.toml +++ b/agb/Cargo.toml @@ -21,6 +21,7 @@ alloc = [] [dependencies] bitflags = "1.2" agb_image_converter = { version = "0.6.0", path = "../agb-image-converter" } +agb_sound_converter = { version = "0.1.0", path = "../agb-sound-converter" } agb_macros = { version = "0.1.0", path = "../agb-macros" } [package.metadata.docs.rs] diff --git a/agb/examples/JoshWoodward-DeadCode.wav b/agb/examples/JoshWoodward-DeadCode.wav new file mode 100644 index 00000000..667064ad Binary files /dev/null and b/agb/examples/JoshWoodward-DeadCode.wav differ diff --git a/agb/examples/i-will-not-let-you-let-me-down.raw b/agb/examples/i-will-not-let-you-let-me-down.raw deleted file mode 100644 index cc272fad..00000000 Binary files a/agb/examples/i-will-not-let-you-let-me-down.raw and /dev/null differ diff --git a/agb/examples/mixer_basic.rs b/agb/examples/mixer_basic.rs index dd1bafb3..e9b03dcb 100644 --- a/agb/examples/mixer_basic.rs +++ b/agb/examples/mixer_basic.rs @@ -6,10 +6,10 @@ extern crate agb; use agb::input::{Button, ButtonController, Tri}; use agb::number::Num; use agb::sound::mixer::SoundChannel; -use agb::Gba; +use agb::{include_wav, Gba}; -// Music - "I will not let you let me down" by Josh Woodward, free download at http://joshwoodward.com -const I_WILL_NOT_LET_YOU_LET_ME_DOWN: &[u8] = include_bytes!("i-will-not-let-you-let-me-down.raw"); +// Music - "Dead Code" by Josh Woodward, free download at http://joshwoodward.com +const DEAD_CODE: &[u8] = include_wav!("examples/JoshWoodward-DeadCode.wav"); #[agb::entry] fn main() -> ! { @@ -20,7 +20,7 @@ fn main() -> ! { let mut mixer = gba.mixer.mixer(); mixer.enable(); - let channel = SoundChannel::new(I_WILL_NOT_LET_YOU_LET_ME_DOWN); + let channel = SoundChannel::new(DEAD_CODE); let channel_id = mixer.play_sound(channel).unwrap(); loop { diff --git a/agb/src/lib.rs b/agb/src/lib.rs index 8864b605..2ef4d0d2 100644 --- a/agb/src/lib.rs +++ b/agb/src/lib.rs @@ -26,6 +26,7 @@ pub mod input; pub mod sound; pub use agb_image_converter::include_gfx; +pub use agb_sound_converter::include_wav; pub use agb_macros::entry;