Author Topic: Increase or decrease rate of all TTS reading with 1 command.  (Read 3162 times)

Ciryan

  • Newbie
  • *
  • Posts: 14
Increase or decrease rate of all TTS reading with 1 command.
« on: January 23, 2018, 11:19:06 AM »
Hello there.

Is it possible to have a command (or maybe it exists already ?) to increase or decrease the rate of all TTS reading in a profile ?
For instance, if a condition is met, increases the rate by 2. If another is met, sets the rate to -3.

Would be nice to have this feature, but I don't know if it's possible.

Thanks anyway.

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Increase or decrease rate of all TTS reading with 1 command.
« Reply #1 on: January 23, 2018, 11:29:39 AM »
Unfortunately there isn't a 'global' setting. You can only set the speed on each individual play tts cmd I'm afraid.
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Increase or decrease rate of all TTS reading with 1 command.
« Reply #2 on: January 23, 2018, 03:01:59 PM »
There is a workaround, if you want the equivalent functionality:

You can use SSML '<prosody rate="">' tags to set the speech rate for any given block of text:
Code: [Select]
<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
                   http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
         xml:lang="en-US">
<prosody rate="200%">
this is a test sentence
</prosody>
</speak>

If you replace the percentage with a variable by using a token, you can set the rate for any block of text in the profile that uses this template by changing the value of said variable:
Code: [Select]
<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
                   http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
         xml:lang="en-US">
<prosody rate="{INT:SpeechRate}%">
this is a test sentence
</prosody>
</speak>


tags can also be embedded within other tags, if you require different rates within the same block of text.:
Code: [Select]
<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
                   http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
         xml:lang="en-US">
<prosody rate="200%">
this is a <prosody rate="10%">test</prosody> sentence
</prosody>
</speak>

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Increase or decrease rate of all TTS reading with 1 command.
« Reply #3 on: January 23, 2018, 03:32:59 PM »
Expanding on the comments from TheThingIs, VoiceAttack does not use the global Text to Speech "voice speed" setting that you can select within the Windows Speech Properties dialog. TTS reading is on a per-action basis.

It is possible to change the Windows global voice speed setting within VA using an inline function that performs registry reads and writes (likely followed by a profile switch, VA restart, or VA profile reset). Though Gary would need to implement an option to have VA bypass the action-level voice speed and instead use the global Windows voice speed. I'd wager there would be more benefit and flexibility if Gary implemented global TTS parameters (VoiceAttack only) and actions for modifying those parameters.