april_asr

Crates.ioapril_asr
lib.rsapril_asr
version0.1.31
sourcesrc
created_at2023-06-04 04:33:13.534763
updated_at2023-06-05 18:10:32.358957
descriptionOffline open source speech recognition API based on next-generation Kaldi
homepage
repositoryhttps://github.com/abb128/april-asr
max_upload_size
id881986
size61,998
(fastfists)

documentation

https://docs.rs/april_asr

README

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();
Commit count: 150

cargo fmt