diff --git a/whisper-cpp-2023/rust.d/src/main.rs b/whisper-cpp-2023/rust.d/src/main.rs index fb16b7c..68c819c 100644 --- a/whisper-cpp-2023/rust.d/src/main.rs +++ b/whisper-cpp-2023/rust.d/src/main.rs @@ -15,9 +15,6 @@ fn main() { params.set_print_realtime(false); params.set_print_timestamps(false); - // assume we have a buffer of audio data - // here we'll make a fake one, floating point samples, 32 bit, 16KHz, mono - //let audio_data = vec![0_f32; 16000 * 2]; let (header, data) = wav::read(&mut std::fs::File::open( &std::env::var("WAV").unwrap_or(String::from("../git.d/samples/jfk.wav")) ).expect("failed to open .wav")).expect("failed to decode .wav"); @@ -26,11 +23,9 @@ fn main() { let data16 = data.as_sixteen().expect("wav is not 32bit floats"); let audio_data = &whisper_rs::convert_integer_to_float_audio(&data16); - // now we can run the model ctx.full(params, &audio_data[..]) .expect("failed to run model"); - // fetch the results let num_segments = ctx.full_n_segments(); for i in 0..num_segments { let segment = ctx.full_get_segment_text(i).expect("failed to get segment");