Author Topic: Plug-in for using Microsoft Cognitive Service voices  (Read 8380 times)

jamescl604

  • Newbie
  • *
  • Posts: 4
Plug-in for using Microsoft Cognitive Service voices
« on: December 24, 2020, 02:28:10 PM »
If you want more natural sounding speech voices for your Voice Attack profiles (vs. the default Windows ones), I wrote a free plug-in that allows you to use any of the ones in Microsoft's Cognitive Text-to-Speech service.  It does require you to setup an Azure account and setup a free-tiered Speech account (pretty easy).

Added bonus: you can have it add a "Radio audio effect" to make the voice sound like it's coming from a radio/walkie talkie.  I use it for adding a co-pilot for my flights in Microsoft Flight Simulator 2020  8)

Details and download is managed on github:
https://github.com/jamescl604/MSCognitiveSpeechForVoiceAttack

Have fun!
« Last Edit: December 29, 2020, 01:31:29 AM by jamescl604 »

steve25469

  • Newbie
  • *
  • Posts: 5
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #1 on: December 11, 2022, 04:33:11 PM »
This is amazing! I was hoping the natural voices would be available directly in the VA speech engine (once I installed them in windows' text to speech / narrator. Once I realized that wasn't the case at this time, I was lucky enough to find your plugin! The neural/natural voices are amazing for working alongside VoiceAttack.

I also had a question I was hoping you could answer though. I saw in the GitHub documentation that you can use variable configs to override the settings in the config file. For example, I usually prefer the clear voice for normal speech, but in certain games such as Flight sim I'd like to override that an add the radio effect. I see the variable to change this should be "MSCognitiveTextToSpeech.AddRadioEffect" and have True or False in the boolean variable. I've tried this with no success though, and not really sure what box needs what information?


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4792
  • RTFM
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #2 on: December 11, 2022, 05:10:43 PM »
Those fields are for passing variables, not values, and they only apply to plugins using the old (pre-v4) plugin interface.

This plugin can check variable values directly, so if you want to override a setting, use the appropriate VoiceAttack action to set the given variable to the desired value (as mentioned in the documentation for the plugin, the setting you are attempting to change would use a Boolean variable) anywhere within your profile, and the plugin will apply that setting instead.
This also means that the variable value doesn't need to be set with every plugin execution (assuming you want to keep the setting, of course).

Do note that once you set a variable value, due to this plugin using globally-scoped variables, the value will remain set for the duration of the session (I.E. until you close VoiceAttack).
If you're using this plugin in multiple profiles, you'd likely want to assign a command to the "Execute a command each time this profile is unloaded" option containing the action(s) to clear those variable values.

steve25469

  • Newbie
  • *
  • Posts: 5
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #3 on: December 11, 2022, 05:30:15 PM »
Thanks so much for the info, I'm still learning my way around and didn't even know yet that there were options in the advanced commands for settings variables like that.  Fantastic that they are set per session and profile, that way if I have a certain game/profile that I want to use the radio effect then I can simply have that option turned on and off with the load and unloading of the profile. That's perfect!
Also, thanks for the super-fast reply and great support here on the forums!

jfjohnny5

  • Newbie
  • *
  • Posts: 1
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #4 on: June 02, 2023, 09:04:31 PM »
@jamescl604 Just want to drop a quick thank you for writing this plugin! It adds such an awesome immersion factor. Really appreciate the work you put into this!!

Wolfang42

  • Newbie
  • *
  • Posts: 13
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #5 on: July 21, 2023, 10:33:58 AM »
Does this plugin allow for Text variables to be passed to it rather than the voiced text placed in the context line?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4792
  • RTFM
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #6 on: July 21, 2023, 10:36:27 AM »
If you want to pass the value of a text variable to a plugin, you can use the "{TXT:}" token in the "Plugin Context" field (as the tooltip for that field, and the documentation, mention).

Wolfang42

  • Newbie
  • *
  • Posts: 13
Re: Plug-in for using Microsoft Cognitive Service voices
« Reply #7 on: July 21, 2023, 11:28:32 AM »
Thank you!