Author Topic: TTS Pitch?  (Read 3733 times)

0 Members and 1 Guest are viewing this topic.

OklahomaGreyBeard

  • Contributor
  • ***
  • Posts: 54
  • Karma: 3
    • View Profile
TTS Pitch?
« on: April 28, 2015, 11:38:10 PM »
Am I just missing it or is there not an option to adjust the pitch and speed of the voice used for tts?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS Pitch?
« Reply #1 on: April 29, 2015, 09:13:17 AM »
You can use the standard "pitch" and "rate" xml tags.

https://msdn.microsoft.com/en-us/library/ms717077%28v=vs.85%29.aspx

e.g.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.6-->
<command id="654" name="high-pitched and fast-talkin' artificial voice" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>&lt;pitch absmiddle="10"&gt;This is a high pitched pseudo person.&lt;/pitch&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>&lt;rate speed="2"&gt;This is a fast-talkin' son of a gun.&lt;/rate&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Talk funny to me</phrase>
</command>

I believe there are some forum posts about this, but we should add this information to the wiki documentation as well.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS Pitch?
« Reply #2 on: April 29, 2015, 09:59:21 AM »
Forgot to say, if you want to change the standard speed of your TTS voice, you can access the Windows TTS properties window directly from VC's Options menu and set it there.

http://voxcommando.com/mediawiki/index.php?title=Main_Menu#Options

Pitch can only be adjusted on a case by case basis.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

OklahomaGreyBeard

  • Contributor
  • ***
  • Posts: 54
  • Karma: 3
    • View Profile
Re: TTS Pitch?
« Reply #3 on: April 29, 2015, 11:40:44 AM »
So the pitch would have to be changed on each command? I'm experimenting with different "personas" that each person could choose to interact with (kind of making the computer schizophrenic) so if I say, Is Alexander there? all tts commands after would use that voice, alternatively my daughter says hello Sally and it changes the voice. However while the default setting for the voice I'm using for Sally is fine, the voice for Alexander sounds much better with the pitch set 2 levels down. Being able to set it once with the set voice command would be what I'm after.

(edit) maybe I could experiment with replacing the values from a payloads xml file using a global variable? ie set each tts response to include the xml pitch setting but replace that setting based on which voice is active?

(edit 2) It seems that the xml pitch setting does not work when using the IVONA voice engine...
« Last Edit: April 29, 2015, 11:54:43 AM by OklahomaGreyBeard »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS Pitch?
« Reply #4 on: April 29, 2015, 11:55:00 AM »
(edit) maybe I could experiment with replacing the values from a payloads xml file using a global variable? ie set each tts response to include the xml pitch setting but replace that setting based on which voice is active?

It could be nice to have TTS.Pitch and TTS.Rate actions so that these could be changed in one fell swoop. Those don't exist at the moment, but could probably be added in a future release. (I'm not the developer, but I have an inside scoop and a strong intuition that this wish will be met at some point. ;-))

Your workaround in the meantime sounds clever and should work -- at the same time that you set the TTS voice, you could set a Pitch variable value. Of course, that means remembering to include the xml tags in every TTS action. A bit of a pain, but doable.

Or, if you can live with it as is for now, usually new releases of VC don't take *that* long to come out.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

OklahomaGreyBeard

  • Contributor
  • ***
  • Posts: 54
  • Karma: 3
    • View Profile
Re: TTS Pitch?
« Reply #5 on: April 29, 2015, 02:39:57 PM »
considering your vox commando version in the xml above is higher than what's available I figured you had the inside scoop.  :biglaugh I have plenty of other things to get setup with it first anyway so I'll table that idea for a bit I think.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: TTS Pitch?
« Reply #6 on: April 29, 2015, 04:19:50 PM »
(edit 2) It seems that the xml pitch setting does not work when using the IVONA voice engine...

Yes, that's true. Ivona uses a slightly different markup standard. http://developer.ivona.com/en/ttsresources/ssml/ssml.html

For Ivona voices you need to use the "prosody" tag with a pitch attribute:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.6-->
<command id="667" name="Ivona high-pitched and fast-talkin' artificial voice" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>&lt;prosody pitch="x-high"&gt;This is a high pitched pseudo person.&lt;/prosody&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>TTS.Speak</cmdType>
    <params>
      <param>&lt;rate speed="2"&gt;This is a fast-talkin' son of a gun.&lt;/rate&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Talk funny to me</phrase>
</command>
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: TTS Pitch?
« Reply #7 on: May 05, 2015, 01:37:03 PM »
It could be nice to have TTS.Pitch and TTS.Rate actions so that these could be changed in one fell swoop. Those don't exist at the moment, but could probably be added in a future release.

I will add an action to adjust the "rate" but "pitch" is not a property that can be set on SAPI TTS objects directly (for some reason) so you will have to continue using XML mark-up for that.