diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2017-10-15 21:22:25 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2017-10-15 21:22:25 +0200 |
commit | 44e8d9cee54a24367d25410f78aa10d479eda572 (patch) | |
tree | c437d8ee3ab88797c6c6cc1928e6b756fc4045c0 /src/transforms.rs | |
parent | 8fd6dd041fddaedfadd2e5aa4b6072ef7e106393 (diff) |
Moved emscripten APIs to their own module and added stubs for other methods
Diffstat (limited to 'src/transforms.rs')
-rw-r--r-- | src/transforms.rs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/transforms.rs b/src/transforms.rs index 656255b..55f81b6 100644 --- a/src/transforms.rs +++ b/src/transforms.rs @@ -236,19 +236,3 @@ pub fn align_to_rising_edge(samples: &[f32]) -> Vec<f32> { .cloned() .collect() } - - -#[cfg(target_os = "emscripten")] -pub mod emscripten_api { - #[no_mangle] - pub extern "C" fn find_fundamental_frequency(signal: *const f32, signal_length: isize, sample_rate: f32) -> f32 { - use std::slice; - let signal_slice = unsafe { - &slice::from_raw_parts(signal, signal_length as usize) - }; - - println!("Signal is {:?}", signal_slice); - println!("Sample rate is {:?}Hz", sample_rate); - super::find_fundamental_frequency(&signal_slice, sample_rate).unwrap_or(0.0) - } -} |