Add new frequency option

This commit is contained in:
Gwilym Kuiper 2022-06-11 13:05:30 +01:00
parent 0a9a3fdf1d
commit 73d6dc448f
3 changed files with 7 additions and 1 deletions

View file

@ -19,6 +19,7 @@ proc-macro = true
[features]
freq18157 = []
freq32768 = []
[dependencies]
hound = "3.4"

View file

@ -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 {

View file

@ -17,6 +17,7 @@ debug = true
[features]
default = []
freq18157 = ["agb_sound_converter/freq18157"]
freq32768 = ["agb_sound_converter/freq32768"]
[dependencies]
bitflags = "1"