Crate mutter

Source
Expand description

§Mutter

Mutter is a Rust library that makes transcription with the Whisper transcription models easy and accesible in Rust. It’s a wrapper around whisper-rs which is in turn a wrapper around whisper.cpp.

use mutter::{Model, ModelType};

let model = Model::download(&ModelType::BaseEn).unwrap();
let mp3: Vec<u8> = download_mp3(); // Your own function to download audio
let translate = false;
let individual_word_timestamps = false;
let threads = Some(8);
let transcription = model.transcribe_audio(mp3, translate, individual_word_timestamps, threads).unwrap();
println!("{}", transcription.as_text());
println!("{}", transcription.as_srt());

§Codecs

Mutter supports all codecs that Rodio, the audio backend, supports.

  • MP3 (Symphonia)
  • WAV (Hound)
  • OGG Vorbis (lewton)
  • FLAC (claxon)

Alternatively, enable the minimp3 feature to use the minimp3 backend.

You can also enable any of these features to enable the optional symphonia backend for these features.

symphonia-aac = ["rodio/symphonia-aac"]
symphonia-all = ["rodio/symphonia-all"]
symphonia-flac = ["rodio/symphonia-flac"]
symphonia-isomp4 = ["rodio/symphonia-isomp4"]
symphonia-mp3 = ["rodio/symphonia-mp3"]
symphonia-vorbis = ["rodio/symphonia-vorbis"]
symphonia-wav = ["rodio/symphonia-wav"]

Modules§

transcript

Structs§

Model
Model struct. Can be constructed with Model::new or Model::download. Contains the Whisper model and its context.
ModelTypeIter
An iterator over the variants of ModelType

Enums§

ModelError
Crate error that contains an enum of all possible errors related to the model.
ModelType