Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: chief1983 on April 21, 2015, 04:48:52 pm

Title: VS2013 TTS + Voice Recognition Build
Post by: chief1983 on April 21, 2015, 04:48:52 pm
As many of you know, the VS 2008 nightly builds have long had TTS and Voice Recognition support disabled because we have many users using the Express edition of VS2008, and it can't compile with those flags enabled.  So we left them disbaled in SVN, and I only enabled them in release builds because I've been too lazy to script enabling them as part of the nightly process.  However, the new VS 2013 Community Edition (which is free) can compile Speech and Voicerec builds just like the paid versions!  At least, my initial attempt looks promising.  I want to have some people test it to make sure I haven't goofed it up.  I'll be retiring VS2008 as the nightly build platform soon, and switching to 2013 (or newer).  If these builds work as they seem to, we should be able to enable speech and voicerec for 2013 by default in SVN and I won't have to worry about modifying the nightly script to enable them.  Plus, anyone else using 2013 to make builds will have them enabled as well.  Should be compatible with Windows XP+, please test and let me know if TTS and if you can, Voice Recognition are working.  Builds below.

fs2_open_3_7_3_vs2013_tts_voicer.7z (http://swc.fs2downloads.com/builds/WIN/fs2_open_3_7_3_vs2013_tts_voicer.7z) (SSE2, r11315)
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: Cyborg17 on April 21, 2015, 05:46:21 pm
How does FSO use voice recognition?
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: chief1983 on April 22, 2015, 11:17:26 am
Honestly, I don't know.  There is some sort of framework for issuing commands somehow, by voice.  That's all I know.  But I've gotten some promising reports that the speech works, and the -voicer flag brings up the Windows voice recognition helper, so that's good.

Edit:  Found the Voice Recognition wiki page (http://www.hard-light.net/wiki/index.php/Voice_Recognition).
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: Mongoose on April 22, 2015, 07:22:54 pm
Heh, I think that article was the only thing I ever really contributed to the wiki.  I did play with voice enabled a few times, and it worked fairly well from what I can remember.  Besides the convenience factor, the best part by far was the immersion: it almost felt like you were barking orders at your wingmen.
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: AdmiralRalwood on April 22, 2015, 08:46:10 pm
I should note that voice recognition did indeed work with this build, and as a result, voice recognition and text-to-speech are now enabled by default in the MSVS 2013 project files (among other changes (https://svn.icculus.org/fs2open?view=rev&revision=11318)).

Voice recognition also got a few extra features (http://www.hard-light.net/forums/index.php?topic=37643.msg880793#msg880793) exhumed from the old unstable branch that never got ported to trunk before; on top of that, I'm fiddling with the code to allow people to define new wing names in the grammar file instead of needing to add them to a hardcoded list (and since the grammar file can be read at runtime, this should (eventually) let mods accommodate their specific naming schemes with voice recognition).
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: Trivial Psychic on April 23, 2015, 07:28:29 am
I don't suppose there's a way to create a grammar file for the text-to-speech so we can tell the computer the proper way to pronounce certain names and complex words.
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: AdmiralRalwood on April 23, 2015, 07:42:18 am
I don't suppose there's a way to create a grammar file for the text-to-speech so we can tell the computer the proper way to pronounce certain names and complex words.
Yes, there is.

You can just flat-out change the "words" it's looking for (I experimented by making "Gee Tee Eff Oh" activate the jump drive), or you can provide a "PRON" attribute to the phrase, which specifies the pronunciation the recognizer listens for.

I tested my changes by adding "Falcata" to the list of recognizable wings and then shouting orders during Her Finest Hour, and I didn't have to provide any pronunciation hints for it to recognize "Falcata", so... it seems to work rather well.
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: chief1983 on April 23, 2015, 09:40:05 am
I think there might have been some confusion on his question, he was asking about TTS and not Voice Recognition.  Unless TTS somehow accesses that grammar file as well, that's the first I've heard though.  I thought that FRED had the ability to specify a phonetic version of a string as a TTS aid though.
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: AdmiralRalwood on April 23, 2015, 04:34:56 pm
I think there might have been some confusion on his question, he was asking about TTS and not Voice Recognition.
Oh, doy. I must've been really tired when I posted that.

There is a system for providing markup information through XML in the text, which may even work on both the Windows and non-Windows version of TTS. However, FSO has no way of stripping out this XML when displaying text to the user, nor does there appear to be a way of providing a pronunciation lexicon for common terms. I'll be honest, I starting working on voice recognition because I thought it was an interesting feature; I don't particularly think the same of TTS. :P
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: Mongoose on April 23, 2015, 06:10:07 pm
(I experimented by making "Gee Tee Eff Oh" activate the jump drive)
Can we make that default behavior? :D
Title: Re: VS2013 TTS + Voice Recognition Build
Post by: AdmiralRalwood on April 23, 2015, 06:27:59 pm
(I experimented by making "Gee Tee Eff Oh" activate the jump drive)
Can we make that default behavior? :D
When this patch gets incorporated, you'll be able to make it do whatever you want with a custom grammar file. :P

Latest change: changed FSO from using a "shared" recognizer to an "in-process" recognizer. This means that launching FSO with -voicer will no longer open up Windows's voice recognition thing and make you turn it on for voice recognition to work, meaning that mumbling something could open the start menu or a web browser or something like that. Now you can use voice recognition in FSO and only FSO. :)