Expand description
§april_asr
This crate is a (safe) wrapper around April ASR through its C API. From its GitHub page:
- April-ASR is a minimal library that provides an API for offline streaming speech-to-text applications
§Usage
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();Structs§
- Model
- The speach recognition model.
- Session
- A session is a single instance of a speech recognition engine.
- Token
- A token is a single word or punctuation mark that is returned from the model
Enums§
- April
Error - Error Types for this crate
- April
Result - The result of a completion passed into handler function.
- Session
Flags - Flags for how the
Sessionshould behave. - Token
Flags - Flags for what type of token is being returned.
Functions§
- april_
asr_ init - Initialize the April ASR library.