2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 16:33:43 -04:00

voice notifications and settings UI rework

This commit is contained in:
Xjph
2021-09-04 18:36:03 -02:30
parent 2070aa1c98
commit c883821fb6
3 changed files with 288 additions and 114 deletions

View File

@ -2,6 +2,7 @@
using Observatory.Framework.Files;
using Observatory.Framework.Interfaces;
using System;
using System.Runtime.InteropServices;
namespace Observatory.PluginManagement
{
@ -26,6 +27,17 @@ namespace Observatory.PluginManagement
{
InvokeNativeNotification(title, text);
}
if (Properties.Core.Default.VoiceNotify && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var speech = new System.Speech.Synthesis.SpeechSynthesizer()
{
Volume = Properties.Core.Default.VoiceVolume,
Rate = Properties.Core.Default.VoiceRate
};
speech.SelectVoice(Properties.Core.Default.VoiceSelected);
speech.SpeakAsync(title + ": " + text);
}
}
}