Skip to content

Commit

Permalink
Docs and tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Tkael committed Aug 13, 2021
1 parent 7f43522 commit 0904e91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion EDDI/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Full details of the variables available for each noted event, and VoiceAttack in
### 4.0.1-b4
* Core
* Added a speculative fix for a bug that could prevent speech when the same voice is available from multiple speech synthesizers.

* Refactored to try to improve compatibility with older Windows versions.

### 4.0.1-b3
* Core
* Fixed a bug that would cause speech volume for some voices to be either 0% or 100%.
Expand Down
16 changes: 11 additions & 5 deletions SpeechService/SpeechService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,19 @@ private SpeechService()
var voiceStore = new HashSet<VoiceDetails>(); // Use a Hashset to ensure no duplicates

// Windows.Media.SpeechSynthesis isn't available on older Windows versions so we must check if we have access
var temp = RuntimeEnvironment.GetSystemVersion();
if (ApiInformation.IsTypePresent("Windows.Media.SpeechSynthesis.SpeechSynthesizer"))
try
{
// Prep the Windows.Media.SpeechSynthesis synthesizer
windowsMediaSynth = new WindowsMediaSynthesizer(ref voiceStore);
if (ApiInformation.IsTypePresent("Windows.Media.SpeechSynthesis.SpeechSynthesizer"))
{
// Prep the Windows.Media.SpeechSynthesis synthesizer
windowsMediaSynth = new WindowsMediaSynthesizer(ref voiceStore);
}
}

catch (Exception e)
{
Logging.Warn($"Unable to initialize Windows.Media.SpeechSynthesis.SpeechSynthesizer, {RuntimeInformation.OSDescription}", e);
}

// Prep the System.Speech synthesizer
systemSpeechSynth = new SystemSpeechSynthesizer(ref voiceStore);

Expand Down

0 comments on commit 0904e91

Please sign in to comment.