Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

voice: minor refactoring in the voice gen script

Change-Id: If0082ca2cb89e36fd5a1c4664cad0c594501db31

+7 -9
+7 -9
tools/voice.pl
··· 335 335 # Run genlang and create voice clips for each string 336 336 sub generateclips { 337 337 our $verbose; 338 - my ($language, $target, $encoder, $encoder_opts, $tts_engine, $tts_engine_opts, $existingids) = @_; 338 + my ($language, $target, $encoder, $encoder_opts, $tts_object, $tts_engine_opts, $existingids) = @_; 339 339 my $english = dirname($0) . '/../apps/lang/english.lang'; 340 340 my $langfile = dirname($0) . '/../apps/lang/' . $language . '.lang'; 341 341 my $correctionsfile = dirname($0) . '/voice-corrections.txt'; ··· 362 362 } 363 363 open(VOICEFONTIDS, " < $idfile"); 364 364 365 - my $tts_object = init_tts($tts_engine, $tts_engine_opts, $language); 366 365 # add string corrections to tts_object. 367 366 my @corrects = (); 368 367 open(VOICEREGEXP, "<$correctionsfile") or die "Can't open corrections file!\n"; ··· 419 418 # If we have a pool of snippets, see if the string exists there first 420 419 if (defined($ENV{'POOL'})) { 421 420 $pool_file = sprintf("%s/%s-%s.enc", $ENV{'POOL'}, 422 - md5_hex(Encode::encode_utf8("$voice $tts_engine $tts_engine_opts $encoder_opts")), 421 + md5_hex(Encode::encode_utf8("$voice ". $tts_object->{"name"}." $tts_engine_opts $encoder_opts")), 423 422 $language); 424 423 if (-f $pool_file) { 425 424 printf("Re-using %s (%s) from pool\n", $id, $voice) if $verbose; ··· 589 588 # add the tools dir to the path temporarily, for calling various tools 590 589 $ENV{'PATH'} = dirname($0) . ':' . $ENV{'PATH'}; 591 590 591 + my $tts_object = init_tts($s, $S, $l); 592 + 592 593 # Do what we're told 593 594 if ($V == 1) { 594 595 # Only do the panic cleanup for voicefiles ··· 598 599 printf("Generating voice\n Target: %s\n Language: %s\n Encoder (options): %s (%s)\n TTS Engine (options): %s (%s)\n", 599 600 defined($t) ? $t : "unknown", 600 601 $l, $e, $E, $s, $S); 601 - generateclips($l, $t, $e, $E, $s, $S, $f); 602 + generateclips($l, $t, $e, $E, $tts_object, $S, $f); 602 603 createvoice($l, $i, $f); 603 604 deleteencs(); 604 - } 605 - elsif ($C) { 605 + } elsif ($C) { 606 606 printf("Generating .talk clips\n Path: %s\n Language: %s\n Encoder (options): %s (%s)\n TTS Engine (options): %s (%s)\n", $ARGV[0], $l, $e, $E, $s, $S); 607 - my $tts_object = init_tts($s, $S, $l); 608 607 gentalkclips($ARGV[0], $tts_object, $e, $E, $S, 0); 609 608 shutdown_tts($tts_object); 610 - } 611 - else { 609 + } else { 612 610 printusage(); 613 611 exit 1; 614 612 }