ngld / old-knossos

A mod launcher/installer for FSO
https://fsnebula.org/knossos/
Apache License 2.0
58 stars 23 forks source link

TTS Voice not set properly #165

Open Coolcord opened 5 years ago

Coolcord commented 5 years ago

Version: Knossos v0.13.3 OS: Windows 7 64-bit

Symptom: When trying to use a different TTS voice under the speech voice combo box, Microsoft Anna is always used, regardless of the selection.

Additional Notes: The GUI visually saves and loads the TTS voice selection fine. Also the "Test" button in the GUI uses the right voice. However, Microsoft Anna will always be used in-game (as well as mission briefings, techroom, etc.). For what it's worth, I can confirm that these alternative TTS voices work in other launchers, such as wxLauncher.

Steps to Reproduce:

  1. Install a 3rd party TTS voice. For this example, try this one, though I have seen it happen with many others
  2. Open a 32-bit build of Knossos on a 64-bit Windows OS
  3. Go to Settings -> Speech -> Voice -> Select "ScanSoft Daniel_Full_22kHz"
  4. Enable "Use Speech in Tech Room", Press Save, then Launch a Freespace game
  5. Open the Tech Room. Notice that the TTS voice is not ScanSoft Daniel
jg18 commented 5 years ago

I can take a look at this.

jg18 commented 5 years ago

Hmm, I can't reproduce this issue in Windows 10 x64 with latest Knossos master. I select all four checkboxes for where to use speech (briefings, tech room, etc.) and select a voice from Knossos's Settings page and then scroll up to the top of the Settings page and press Save, then launch a game (I tried Retail FS2) and go to the tech room. The voice I select reads the text.

I'll try next to reproduce using Knossos 0.13.3.

jg18 commented 5 years ago

I can partially reproduce with 0.13.3, again on Windows 10.

The two voices that were available when I used latest Knossos master (David and Zira) still work in the tech room. However, 0.13.3's Settings page includes two other voices that were not available in Knossos master, Kate and Paul. When I press the Test button with one of those voices selected, there is no sound, and when I select one of those two voices and press Save in settings and then launch Retail FS2, the last voice I selected among David and Zira speaks, not Kate or Paul.

I need to do a little research on the David/Zira voices (which I assume are new for Windows 10) vs. the Kate/Paul voices. I suspect they are from different Microsoft Speech APIs.

Coolcord commented 5 years ago

There was a typo in my original post. It's always "Microsoft Anna," not Kate, which is the Windows 7 default voice. I've edited it to clarify.

I just tried it with the YAL launcher, and just like wxLauncher, I can load other TTS voices in-game fine.

In Knossos, I've tried Kate and Paul, and it's still Microsoft Anna in the techroom for me. I also tried Krystal, Mike, and Audrey by AT&T and I get the exact same issue. To clarify further, the test button in the GUI works fine for all of these voices.

jg18 commented 5 years ago

Interesting, thanksf or the extra info. I tried wxLauncher 0.12.0 RC2 and the same four voices are available (David, Zira, Kate, Paul). As with Knossos, when I select David or Zira and press Test I get speech with the selected voice. However, also as with Knossos, selecting Kate or Paul and pressing Test does not result in any speech. Thus the issue doesn't seem to be with Knossos. Perhaps Kate and Paul are not compatible with Windows 10? Or perhaps they are listed when Knossos/wxL queries Windows for available voices, but Kate and Paul are not actually installed on Windows 10? Not sure. I may need to do more research or even see if I have a copy of Windows 7 that I can install in a VM.

Coolcord commented 5 years ago

I can reproduce the issue on another Windows 7 machine with a clean Freespace install. The symptoms are exactly the same. The same thing also happens on my Windows 10 laptop.

Coolcord commented 5 years ago

I think I have figured out what's going on now.

wxLauncher and YAL both use 32-bit builds of Freespace by default. However, Knossos uses the experimental 64-bit builds of Freespace. The 64-bit builds of Freespace seem to be incompatible with all of the 3rd party TTS voices I'm using. This causes the game to fall back to the stock voice (Anna on 7 and David on 10). For what it's worth, it would be nice if Knossos gave the option to use 32-bit builds of Freespace, as that would resolve compatibility issues like this. Regardless, there's a little more going on here than meets the eye.

On 64-bit Windows operating systems, registry keys for all available 32-bit TTS voices are stored here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Speech\Voices\Tokens

And 64-bit TTS voices are stored here (notice that there is no Wow6432Node):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens

If the user is running a 32-bit build of Knossos, the 32-bit TTS voices will be populated. However, 32-bit Knossos launches a 64-bit app, which is expecting 64-bit TTS voices. In other words, 32-bit builds of Knossos on 64-bit operating systems are not populating the TTS voice combo box with the correct voices.

The easy solution to this problem is to run a 64-bit build of Knossos, as this will only happen on 64-bit operating systems running 32-bit Knossos builds. Alternatively (just a suggestion), Knossos could populate TTS voices based upon the architecture that it will launch, rather than what it is currently running on.

ngld commented 5 years ago

For what it's worth, it would be nice if Knossos gave the option to use 32-bit builds of Freespace,

Try this: Go to the settings page in Knossos, open the "Global Flags" section, select your FSO version and then select the 32bit executable in the "Executable" field. Save and see if that fixes the problem. This method isn't really documented anywhere but should work.

As a side note: The 64bit builds are no longer experimental and will eventually become the new standard.

Knossos could populate TTS voices based upon the architecture that it will launch

This would be the ideal solution but involves two problems:

The reason I distribute Knossos as 32bit is that it runs on both architectures and the benefits of having a 64bit build available aren't worth the effort involved.

@jg18 When you launch Knossos master, it's launched using the Python installed on your system which is most likely 64bit. The Knossos 0.13.3 installer only installs a 32bit executable so that might cause the differences you were seeing. Not sure why some of the voices didn't work for you though... If you want to debug further, launching that build in debug mode (set KN_DEBUG=1 before launching it through cmd.exe) and checking the debug log might help.

Coolcord commented 5 years ago

Try this: Go to the settings page in Knossos, open the "Global Flags" section, select your FSO version and then select the 32bit executable in the "Executable" field. Save and see if that fixes the problem. This method isn't really documented anywhere but should work.

This does work as a workaround. Thanks! However, it seems that the Stable package does not include a 32-bit executable. Only the Nightlies do.