Ran cargo fmt

This commit is contained in:
James Bruska 2023-03-27 10:35:23 -04:00
parent bad88c38d8
commit 30ff41989b
2 changed files with 5 additions and 2 deletions

View file

@ -1,10 +1,10 @@
// This example is not going to build in this folder. // This example is not going to build in this folder.
// You need to copy this code into your project and add the dependencies whisper_rs and hound 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 hound;
use std::fs::File; use std::fs::File;
use std::io::Write; use std::io::Write;
use whisper_rs::{FullParams, SamplingStrategy, WhisperContext}; use whisper_rs::{FullParams, SamplingStrategy, WhisperContext};
use hound;
/// Loads a context and model, processes an audio file, and prints the resulting transcript to stdout. /// Loads a context and model, processes an audio file, and prints the resulting transcript to stdout.
fn main() { fn main() {

View file

@ -63,7 +63,10 @@ pub fn convert_integer_to_float_audio_simd(samples: &[i16]) -> Vec<f32> {
/// # Returns /// # Returns
/// A vector of 32 bit floating point mono PCM audio samples. /// A vector of 32 bit floating point mono PCM audio samples.
pub fn convert_stereo_to_mono_audio(samples: &[f32]) -> Vec<f32> { pub fn convert_stereo_to_mono_audio(samples: &[f32]) -> Vec<f32> {
samples.chunks_exact(2).map(|x| (x[0] + x[1]) / 2.0).collect() samples
.chunks_exact(2)
.map(|x| (x[0] + x[1]) / 2.0)
.collect()
} }
/// Convert 32 bit floating point stereo PCM audio to 32 bit floating point mono PCM audio. /// Convert 32 bit floating point stereo PCM audio to 32 bit floating point mono PCM audio.