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: add a 'make talkclips' target for voice builds.

This will use the configured tts engine and language to generate
the talk clips for a specified directory.

TALKDIR=/path/to/somehere make talkclips
TALKDIR=/path/to/somehere make talkclips-force

If 'TALKDIR' is not defined then it will error out gracefully.

Normally if a talkclip is present already it will not regenerate the file,
but 'make talkclip-force' will regenerate it anyway.

Change-Id: I62683f9e5ca395fd303ac6029096c20da1e96d01

+21 -4
+11 -1
tools/root.make
··· 374 374 375 375 voice: voicetools $(BUILDDIR)/apps/features 376 376 $(SILENT)for f in `cat $(BUILDDIR)/apps/features`; do feat="$$feat:$$f" ; done ; \ 377 - for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -V -l=$$lang -t=$(MODELNAME)$$feat -i=$(TARGET_ID) -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)"; done \ 377 + for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -V -l=$$lang -t=$(MODELNAME)$$feat -i=$(TARGET_ID) -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)"; done 378 + 379 + talkclips: voicetools 380 + $(SILENT)if [ -z '$(TALKDIR)' ] ; then \ 381 + echo "Must specify TALKDIR"; \ 382 + else \ 383 + for lang in `echo $(VOICELANGUAGE) |sed "s/,/ /g"`; do $(TOOLSDIR)/voice.pl -C -l=$$lang -e="$(ENCODER)" -E="$(ENC_OPTS)" -s=$(TTS_ENGINE) -S="$(TTS_OPTS)" $(FORCE) "$(TALKDIR)" ; done \ 384 + fi 385 + 386 + talkclips-force: FORCE=-F 387 + talkclips-force: talkclips 378 388 379 389 endif 380 390
+10 -3
tools/voice.pl
··· 19 19 use warnings; 20 20 use File::Basename; 21 21 use File::Copy; 22 - use vars qw($V $C $t $l $e $E $s $S $i $v $f); 22 + use vars qw($V $C $t $l $e $E $s $S $i $v $f $F); 23 23 use IPC::Open2; 24 24 use IPC::Open3; 25 25 use Digest::MD5 qw(md5_hex); ··· 63 63 -S=<TTS engine options> 64 64 Options to pass to the TTS engine. Enclose in double quotes if the 65 65 options include spaces. 66 + 67 + -F Force the file to be regenerated even if present 66 68 67 69 -v 68 70 Be verbose ··· 125 127 ); 126 128 127 129 my $trim_thresh = 500; # Trim silence if over this, in ms 130 + my $force = 0; # Don't regenerate files already present 128 131 129 132 # Initialize TTS engine. May return an object or value which will be passed 130 133 # to voicestring and shutdown_tts ··· 427 430 } 428 431 429 432 # Don't generate encoded file if it already exists (probably from the POOL) 430 - if (! -f $enc) { 433 + if (! -f $enc && !$force) { 431 434 if ($id eq "VOICE_PAUSE") { 432 435 print("Use distributed $wav\n") if $verbose; 433 436 copy(dirname($0)."/VOICE_PAUSE.wav", $wav); ··· 540 543 541 544 printf("Talkclip %s: %s", $enc, $voice) if $verbose; 542 545 # Don't generate encoded file if it already exists 543 - next if (-f $enc); 546 + next if (-f $enc && !$force); 544 547 545 548 voicestring($voice, $wav, $tts_engine_opts, $tts_object); 546 549 wavtrim($wav, $trim_thresh, $tts_object); ··· 563 566 564 567 # Check parameters 565 568 my $printusage = 0; 569 + 566 570 unless (defined($V) or defined($C)) { print("Missing either -V or -C\n"); $printusage = 1; } 567 571 if (defined($V)) { 568 572 unless (defined($l)) { print("Missing -l argument\n"); $printusage = 1; } ··· 575 579 elsif (defined($C)) { 576 580 unless (defined($ARGV[0])) { print "Missing path argument\n"; $printusage = 1; } 577 581 } 582 + 583 + $force = 1 if (defined($F)); 584 + 578 585 unless (defined($e)) { print("Missing -e argument\n"); $printusage = 1; } 579 586 unless (defined($E)) { print("Missing -E argument\n"); $printusage = 1; } 580 587 unless (defined($s)) { print("Missing -s argument\n"); $printusage = 1; }