Skip to content

Commit

Permalink
Merge pull request #618 from pmatis/swift_pitch_rate_fix
Browse files Browse the repository at this point in the history
Allow swift to change voice pitch and such with newer tags
  • Loading branch information
hplato authored Oct 9, 2016
2 parents 4f4c00f + 7af59b7 commit 4bce107
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/Voice_Text.pm
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,19 @@ sub speak_text {
$speak_pgm_arg .= qq[ -e 'set $parms{volume_reset}'];
}
}
elsif ( $speak_engine =~ /(theta|swift)/i ) {

elsif ( $speak_engine eq 'swift' ) {
#<prosody pitch='X' rate='X'>
my $prosodyparms;
$prosodyparms .= " pitch='$parms{pitch}'" if $parms{pitch};
$prosodyparms .= " rate='$parms{rate}'" if $parms{rate};
$prosodyparms .= " volume='$parms{ttsvolume}'" if $parms{ttsvolume};
$parms{text} = '<prosody' . $prosodyparms . '>' . $parms{text} . '</prosody>' if $prosodyparms;

$speak_pgm_arg .= ' -n ' . "'$parms{voice}'" if $parms{voice};
$speak_pgm_arg .= ' -o ' . $parms{to_file} if $parms{to_file}; # Not working yet??
$speak_pgm_arg .= qq[ "$parms{text}"];
}
elsif ( $speak_engine eq 'theta' ) {
$speak_pgm_arg .= " -S $parms{pitch}" if $parms{pitch};
$speak_pgm_arg .= " -r $parms{rate}" if $parms{rate};
if ( $speak_engine eq 'theta' ) {
Expand Down

0 comments on commit 4bce107

Please sign in to comment.