diff --git a/Cargo.toml b/Cargo.toml index 1de051c..36fdd00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,11 @@ repository = "https://github.com/tazz4843/whisper-rs" [dependencies] whisper-rs-sys = { path = "sys", version = "0.3" } +[dev-dependencies] +hound = "3.5.0" + [features] simd = [] [package.metadata.docs.rs] -features = ["simd"] \ No newline at end of file +features = ["simd"] diff --git a/examples/audio_transcription.rs b/examples/audio_transcription.rs index bf6b3d8..7831f6d 100644 --- a/examples/audio_transcription.rs +++ b/examples/audio_transcription.rs @@ -1,9 +1,10 @@ // This example is not going to build in this folder. -// You need to copy this code into your project and add the whisper_rs dependency in your cargo.toml +// You need to copy this code into your project and add the dependencies whisper_rs and hound in your cargo.toml use std::fs::File; use std::io::Write; use whisper_rs::{FullParams, SamplingStrategy, WhisperContext}; +use hound; /// Loads a context and model, processes an audio file, and prints the resulting transcript to stdout. fn main() { @@ -14,7 +15,7 @@ fn main() { // Create a params object for running the model. // Currently, only the Greedy sampling strategy is implemented, with BeamSearch as a WIP. // The number of past samples to consider defaults to 0. - let mut params = FullParams::new(SamplingStrategy::Greedy { n_past: 0 }); + let mut params = FullParams::new(SamplingStrategy::Greedy { best_of: 0 }); // Edit params as needed. // Set the number of threads to use to 1. @@ -22,7 +23,7 @@ fn main() { // Enable translation. params.set_translate(true); // Set the language to translate to to English. - params.set_language("en"); + params.set_language(Some("en")); // Disable anything that prints to stdout. params.set_print_special(false); params.set_print_progress(false);