Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use Switch;
- # Generates word samples with random voices and intonation, and
- # saves the output as 16-bit 8 kHz WAV files
- # Put the words you want to generate in this list:
- my @words = qw/yes no/;
- # Generate this many instances of each word:
- my $loopcount = 100;
- # These are the "non-novelty" voices available on my system; you
- # may have to edit the list depending on what is available to you:
- my @voices = qw/Alex Bruce Fred Junior Ralph Agnes Kathy Princess Vicki Victoria/;
- # ================ STOP EDITING HERE ================
- my @emph = ("[[emph +]]","[[emph -]]","");
- my @punc = (".","!","?");
- foreach (@words) {
- for (my $i=0; $i<$loopcount; $i++) {
- my $s = sprintf("say -v %s '[[rate %+d]][[pbas %+d]]%s %s%s' -o %s_%04d.wav --data-format=I16\@8000",
- $voices[rand @voices],
- int(rand(150))+1,
- int(rand(20)-10),
- $emph[rand @emph],
- $_,
- $punc[rand @punc],
- $_,
- $i
- );
- printf("\rGenerating files... '%s' (%d/%d)",$_,$i+1,$loopcount);
- `$s`;
- }
- print(" Finished\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement