Crates.io | april_asr |
lib.rs | april_asr |
version | 0.1.31 |
source | src |
created_at | 2023-06-04 04:33:13.534763 |
updated_at | 2023-06-05 18:10:32.358957 |
description | Offline open source speech recognition API based on next-generation Kaldi |
homepage | |
repository | https://github.com/abb128/april-asr |
max_upload_size | |
id | 881986 |
size | 61,998 |
This crate is a (safe) wrapper around April ASR through its C API. From its GitHub page:
Reading a WAV file and feeding it to the APRIL-ASR model:
use april_asr::{Model, Session, Result, AprilResult};
use std::io::Read;
april_asr::april_asr_init();
let model = Model::new("/path/to/model.april").unwrap();
let session = Session::new(model, april_asr::SessionFlags::SYNC, |result: AprilResult| {
println!("Result: {:?}", result);
});
let mut buffer = Vec::new();
let mut file = std::fs::File::open("/path/to/file.wav").unwrap();
let _ = file.read(&mut buffer);
session.feed_pcm16(buffer);
session.flush();