From 36e85ef78a6eb148c6e76f19b055c60113484796 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 23 Jan 2025 15:50:34 -0500 Subject: [PATCH] voice: Correct a rather embarrasing bug in talk clip generation Introduced Change-Id: I150617267b8866a7ae09bf9c01430e7afbd369ed --- tools/voice.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/voice.pl b/tools/voice.pl index c63f193556..3e3f4d85b7 100755 --- a/tools/voice.pl +++ b/tools/voice.pl @@ -592,21 +592,22 @@ sub gentalkclips { our $verbose; 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); my ($voice, $wav, $enc); my $format = $tts_object->{'format'}; - # Print some progress information - if (++$i % 10 == 0 and !$verbose) { - print("."); - } - # Ignore dot-dirs and talk files if ($file eq '.' || $file eq '..' || $file =~ /\.talk$/) { next; } + # Print some progress information + if (++$i % 10 == 0 and !$verbose) { + print("."); + } + $voice = $file; # Convert some symbols to spaces @@ -620,7 +621,7 @@ sub gentalkclips { if ( -d $path) { # Element is a dir $enc = sprintf("%s/_dirname.talk", $path); if (! -e "$path/talkclips.ignore") { # Skip directories containing "talkclips.ignore" - gentalkclips($path, $tts_object, $encoder, $encoder_opts, $tts_engine_opts, $i); + gentalkclips($path, $tts_object, $language, $encoder, $encoder_opts, $tts_engine_opts, $i); } } else { # Element is a file $enc = sprintf("%s.talk", $path);