Skip to content

Commit 51cdc2e

Browse files
committed
fmt
1 parent 929976c commit 51cdc2e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

examples/tts_zipvoice.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn main() {
1818
let mut reader = hound::WavReader::open(&prompt_path).expect("Failed to open prompt.wav");
1919
let spec = reader.spec();
2020
let prompt_sr = spec.sample_rate as i32;
21-
21+
2222
println!("Prompt audio spec: {:?}", spec);
2323

2424
// Read samples and convert to f32 (mono only for now)
@@ -30,16 +30,20 @@ fn main() {
3030
} else {
3131
reader.samples::<f32>().map(|s| s.unwrap()).collect()
3232
};
33-
33+
3434
// If stereo, convert to mono by averaging channels
3535
if spec.channels == 2 {
3636
prompt_samples = prompt_samples
3737
.chunks(2)
3838
.map(|chunk| (chunk[0] + chunk[1]) / 2.0)
3939
.collect();
4040
}
41-
42-
println!("Loaded {} prompt samples at {} Hz", prompt_samples.len(), prompt_sr);
41+
42+
println!(
43+
"Loaded {} prompt samples at {} Hz",
44+
prompt_samples.len(),
45+
prompt_sr
46+
);
4347

4448
let config = ZipVoiceTtsConfig {
4549
tokens: format!("{}/tokens.txt", model_dir),
@@ -68,7 +72,7 @@ fn main() {
6872
let text = "Hello world."; // Start with simple English text
6973
let speed = 1.0;
7074
let num_steps = 4; // Number of inference steps
71-
75+
7276
println!("Generating speech for: {}", text);
7377

7478
let audio = tts

0 commit comments

Comments
 (0)