VoxCommando

Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: flashguy on December 03, 2015, 07:49:55 AM

Title: Multiple instances with different TTS Languages
Post by: flashguy on December 03, 2015, 07:49:55 AM
Hi,
I would like to run one instance of voxcommando where i can change the TTS Language via Events. Is this somehow possible? An option would also be to have two instances with different TTS Languages.

I have a home automation system and some things need to be said in english and I want features like news and weather to be spoken in German.

Any help is appreciated
Title: Re: Multiple instances with different TTS Languages
Post by: nime5ter on December 03, 2015, 08:17:14 AM
Welcome flashguy,

If it's just the TTS voices you'd like to change, and not the speech recognition language, I think you should be able to use the standard action TTS.SetVoiceName or TTS.SetVoiceNum (http://voxcommando.com/mediawiki/index.php?title=Plugin_TTS#SetVoiceName)

To adapt the example below, replace the TTS voice names in the payload list with your own. You should be able to include both German and English TTS names/voices.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.9-->
<commandGroup open="True" name="Change TTS voice with an event" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="365" name="I'd like to speak to {1} now" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <params>
        <param>OK. I'll let {1} speak now.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>changeTTS</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>I'd like to speak to</phrase>
    <payloadList>Paul, Bridget, Anna</payloadList>
    <phrase optional="true">now</phrase>
  </command>
  <command id="332" name="change TTS voice" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.SetVoiceName</cmdType>
      <params>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Hello, this is {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>changeTTS</event>
  </command>
</commandGroup>
Title: Re: Multiple instances with different TTS Languages
Post by: flashguy on December 03, 2015, 08:59:05 AM
nime5ter, you're the man!

Thanks for the fast feedback. Works like a charm.
Title: Re: Multiple instances with different TTS Languages
Post by: nime5ter on December 03, 2015, 09:18:24 AM
Or the woman, as the case may be. ;-)

Cheers. Happy to help.