diff --git a/agb-sound-converter/Cargo.toml b/agb-sound-converter/Cargo.toml index fa82c038..1a221e16 100644 --- a/agb-sound-converter/Cargo.toml +++ b/agb-sound-converter/Cargo.toml @@ -19,6 +19,7 @@ proc-macro = true [features] freq18157 = [] +freq32768 = [] [dependencies] hound = "3.4" diff --git a/agb-sound-converter/src/lib.rs b/agb-sound-converter/src/lib.rs index ea2117f2..368e74dd 100644 --- a/agb-sound-converter/src/lib.rs +++ b/agb-sound-converter/src/lib.rs @@ -12,10 +12,14 @@ use std::{ }; use syn::parse_macro_input; -#[cfg(not(feature = "freq18157"))] +#[cfg(all(not(feature = "freq18157"), not(feature = "freq32768")))] const FREQUENCY: u32 = 10512; #[cfg(feature = "freq18157")] const FREQUENCY: u32 = 18157; +#[cfg(feature = "freq32768")] +const FREQUENCY: u32 = 32768; +#[cfg(all(feature = "freq18157", feature = "freq32768"))] +compile_error!("Must have at most one of freq18157 or freq32768 features enabled"); #[proc_macro] pub fn include_wav(input: TokenStream) -> TokenStream { diff --git a/agb/Cargo.toml b/agb/Cargo.toml index 013447f7..248b5bd6 100644 --- a/agb/Cargo.toml +++ b/agb/Cargo.toml @@ -17,6 +17,7 @@ debug = true [features] default = [] freq18157 = ["agb_sound_converter/freq18157"] +freq32768 = ["agb_sound_converter/freq32768"] [dependencies] bitflags = "1"