Expand description

ds-transcriber

A deepspeech powered utility for transcribing a microphone stream

Prelude

You can think of this crate as a wrapper for RustAudio’s deepspeech-rs. It aims to provide transcription for microphone audio with optional denoising.

Getting Started

This example shows the quickest way to get started with ds-transcriber. First, add ds-transcriber to your Cargo.toml

ds-transcriber = "1"

Download the DeepSpeech native client and then add its directory to your LD_LIBRARY_PATH and LIBRARY_PATH variables.

Have a look at StreamSettings to fine tune the transcription stream to parameters that better suite your environment

let mut model = ds_transcriber::model::instance_model(
    "model_file.pbmm",
    Some("scorer_file.scorer"),
)?;
let config = ds_transcriber::StreamSettings::default();
let i_said = ds_transcriber::transcribe(config, &mut model)?;
println!("I said: {}", i_said);

Rinse and repeat the last two lines

Features

This crate provides an optional feature of denoising of the audio stream (may result in better transcription). It is disabled by default, to enable it: use either the denoise or full key in the crate’s features list

ds-transcriber = { version = "1", features = ["denoise"] } # or features = ["full"]

Crate example

Clone the repository and run the example

For help with arguments, run:

cargo run --example transcribe -- -h

To start the example, run

cargo run --example transcribe -- -m model_file -s scorer_file -c deepspeech_native_client_dir

The s or --scorer argument is optional, but it is recommended to set one.

Re-exports

This crate also re-exports the deepspeech and nnnoiseless crates (if the denoise feature is enabled). You can use these re-exports instead of also depending on them separately.

Re-exports

pub use deepspeech;

Modules

Instantiates a deep speech model to be used for transcription

Structs

Functions