reduce whisper-rs space
This commit is contained in:
4114
rust-whisper-lib/Cargo.lock
generated
4114
rust-whisper-lib/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,5 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
whisper-rs = { path = "../gitea-whisper-rs", version = "0.8.0" }
|
||||
whisper = { path = "../whisper-burn", version = "0.1.0", features = ["wgpu-backend"] }
|
||||
clap = { version = "4.4.10", features = ["derive"] }
|
||||
wav = "1"
|
||||
|
||||
@@ -61,7 +61,13 @@ fn f32_from_wav_file(path: &String) -> Result<Vec<f32>, String> {
|
||||
return Err("!= 16_000 hz".to_string());
|
||||
}
|
||||
match data.as_sixteen() {
|
||||
Some(data16) => Ok(whisper_rs::convert_integer_to_float_audio(&data16)),
|
||||
Some(data16) => {
|
||||
let mut floats = Vec::with_capacity(data16.len());
|
||||
for sample in data16 {
|
||||
floats.push(*sample as f32 / 32768.0);
|
||||
}
|
||||
Ok(floats)
|
||||
},
|
||||
None => Err(format!("couldnt translate wav to 16s")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user