EDCD / EDDI

Companion application for Elite Dangerous
Other
453 stars 82 forks source link

no indication to the user if an attempt to use a voice fails #2495

Closed slippycheeze closed 1 year ago

slippycheeze commented 1 year ago

What's Wrong (please be as specific as possible)

Apparently I have some broken voices on my system. While I should solve that, other than the messages in the log EDDI gave me no indication of a problem.

note: the first two log lines, with "Message Received: in {voice}: ..." part is my own function, logging what I send to speech synth, and in what voice, as part of debugging this.

From eddi.log:

2023-01-16T17:54:30 [Info] Log:function Message Received: in Microsoft David Desktop: Hello
2023-01-16T17:54:44 [Info] Log:function Message Received: in Microsoft Zira Desktop: Don't get lazy. We know the Thargoids could appear at any minute.
2023-01-16T17:54:49 [Info] SystemSpeechSynthesizer:SystemSpeechSynthesis Speech failed
2023-01-16T17:54:49 [Info] SystemSpeechSynthesizer:SystemSpeechSynthesis Speech failed
2023-01-16T17:54:49 [Warning] SystemSpeechSynthesizer:SystemSpeechSynthesis Speech failed: : {"ClassName":"System.ArgumentException","Message":"Cannot set voice. No matching voice is installed or the voice was disabled.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"   at System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name)\r\n   at EddiSpeechService.SpeechSynthesizers.SystemSpeechSynthesizer.<>c__DisplayClass6_0.<SystemSpeechSynthesis>b__0() in EddiSpeechService\\SpeechSynthesizers\\SystemSpeechSynthesizer.cs:line 109","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":"8\nSelectVoice\nSystem.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\nSystem.Speech.Synthesis.SpeechSynthesizer\nVoid SelectVoice(System.String)","HResult":-2147024809,"Source":"System.Speech","WatsonBuckets":null,"ParamName":null}
2023-01-16T17:54:49 [Warning] SystemSpeechSynthesizer:SystemSpeechSynthesis Speech failed: : {"ClassName":"System.ArgumentException","Message":"Cannot set voice. No matching voice is installed or the voice was disabled.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"   at System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name)\r\n   at EddiSpeechService.SpeechSynthesizers.SystemSpeechSynthesizer.<>c__DisplayClass6_0.<SystemSpeechSynthesis>b__0() in EddiSpeechService\\SpeechSynthesizers\\SystemSpeechSynthesizer.cs:line 109","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":"8\nSelectVoice\nSystem.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\nSystem.Speech.Synthesis.SpeechSynthesizer\nVoid SelectVoice(System.String)","HResult":-2147024809,"Source":"System.Speech","WatsonBuckets":null,"ParamName":null}

What I expected

Something like what I get when a script is broken: a voice announcement that something went wrong. For example, "error. failed to use voice ${whatever}."

Even better, read the content in the default voice, and report the error in a non-interrupting way, so that I at least get the content, if not the entirely expected behaviour.

Steps to reproduce

  1. enable multiple voices in Message Recevied
  2. have broken voices on your system. not sure how you achieve this, but...
  3. ...I bet that if you hard-code a voice called "Entirely Broken" it'll probably have the same effect?
  4. let the message play.

Sorry, can't entirely tell you how I got those broken voices.

Configuration

Tkael commented 1 year ago

Probably there was a registry edit at some point to try to add additional voices.

Do the Desktop voices show up on the Text-to-Speech tab? Do the Desktop voices fail in both standalone mode and VoiceAttack (if you use VoiceAttack)?

Tkael commented 1 year ago

Since the exception occurs when we try to select a voice offered by the synthesizer, I'll start testing to verify that these voices are selectable before adding them to the voice list. I'll also revise EDDI to more gracefully fall back to another voice if the first fails.