From 1694101b23163c688ee4e5ba4da14b796cfec765 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 12 Oct 2024 16:38:33 -0400 Subject: [PATCH] voice: Also apply voice corrections to talkclips Change-Id: I8846610933dd286d39f930f004787d9a5345a9ce --- tools/voice.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/voice.pl b/tools/voice.pl index 1180565b64..e19aef131d 100755 --- a/tools/voice.pl +++ b/tools/voice.pl @@ -583,7 +583,7 @@ sub panic_cleanup { # Generate .talk clips sub gentalkclips { our $verbose; - my ($dir, $tts_object, $encoder, $encoder_opts, $tts_engine_opts, $i) = @_; + my ($dir, $tts_object, $language, $encoder, $encoder_opts, $tts_engine_opts, $i) = @_; my $d = new DirHandle $dir; while (my $file = $d->read) { $file = Encode::decode( locale_fs => $file); @@ -620,6 +620,9 @@ sub gentalkclips { $voice =~ s/\.[^\.]*$//; # Trim extension } + # Apply corrections + $voice = correct_string($voice, $language, $tts_object); + printf("Talkclip %s: %s", $enc, $voice) if $verbose; # Don't generate encoded file if it already exists next if (-f $enc && !$force); @@ -691,7 +694,7 @@ if ($V == 1) { deleteencs(); } elsif ($C) { 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); - gentalkclips($ARGV[0], $tts_object, $e, $E, $S, 0); + gentalkclips($ARGV[0], $tts_object, $l, $e, $E, $S, 0); shutdown_tts($tts_object); } else { printusage();