File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments