1
2pub fn add(left: i32, right: i32) -> i32 {
3 left + right
4 }
6
7pub fn get_silk_version() -> String {
8 unsafe {
9 let result = SKP_Silk_SDK_get_version();
10 let c_str = std::ffi::CStr::from_ptr(result);
11 let str_slice = c_str.to_str().unwrap();
12 str_slice.to_string()
13 }
14}
15
16pub fn silk_decoder(in_file: &str, out_file: &str) -> i32 {
17 let in_file = std::ffi::CString::new(in_file).unwrap();
18 let out_file = std::ffi::CString::new(out_file).unwrap();
19 unsafe {
20 silk_v3_decoder(in_file.as_ptr(), out_file.as_ptr())
21 }
22}
23
24
25extern "C" {
26 fn SKP_Silk_SDK_get_version() -> *const i8;
27 fn silk_v3_decoder(in_file: *const i8, out_file: *const i8) -> i32;
29}