#api #functional #docs #test #ali-nls #fe

ali-nls-sr

Easy ali-nls functional api for fe

3 releases

0.1.2 Mar 20, 2023
0.1.1 Mar 17, 2023
0.1.0 Mar 17, 2023

#232 in WebSocket

Download history 13/week @ 2024-03-29 1/week @ 2024-04-05

51 downloads per month

MIT/Apache

520KB
392 lines

Overview

rust api for

ali-nls websocket doc

Attention:Implementation by test websocket lib, still in primary version

Usage

let mut c = AliNlsToSr::from(AliNlsConfig {
  app_key: "$app_key".to_owned(),
  host: "wss://nls-gateway.cn-shanghai.aliyuncs.com".to_owned(),
});
let cur_p = &env::current_dir().unwrap();
let f = Path::new(cur_p).join("test").join("16000_2_s16le.wav");
let ret = c.sr_from_slicefile(f.as_path()).await;
match ret {
  Ok(r) => {
    if let Some(r_) = r {
      println!("json result is :{:?}", r_);
    }
  }
  Err(e) => {
    println!("[error]{}", e.to_string());
  }
}

Test

> cargo test --package ali-nls-sr --lib -- test_sr --exact --nocapture

Dependencies

~8–18MB
~216K SLoC