#nlp #bindings #audio #speech-recognition #neural-network #wrapper

aprilasr

High-level wrapper for the april-asr C api (libaprilasr) using aprilasr-sys

4 releases

0.2.0 Feb 25, 2024
0.1.2 Feb 16, 2024
0.1.1 Feb 15, 2024
0.1.0 Feb 13, 2024

#409 in Multimedia

GPL-3.0 license

57KB
696 lines

aprilasr

High-level wrapper for the april-asr C api (libaprilasr) using aprilasr-sys.

Read the documentation here: https://abb128.github.io/april-asr/

use aprilasr::{init_april_api, Model, Session};

fn main() {
    init_april_api(1);

    let model = Model::new("april-english-dev-01110_en.april").unwrap();

    let asynchronous = true;
    let no_rt = true;
    let callback = |result_type| println!("{:?}", result_type);

    let session = Session::new(
        &model, callback, asynchronous, no_rt
    ).unwrap();

    session.feed_pcm16(vec![]);
}

Run tests and example after building aprilasr-sys:

$ ./getmodel.sh
$ cargo test
$ ./makewav.sh
$ cargo run --example sync

lib.rs:

aprilasr - rust bindings for the april-asr C api (libaprilasr) Copyright (C) 2024 VHS vhsdev@tutanota.com

This file is part of aprilasr.

aprilasr is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

aprilasr is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

This module provides a Rust interface for interacting with the April ASR library, allowing developers to leverage speech-to-text capabilities in Rust applications.

Dependencies

~0.2–2.4MB
~49K SLoC