2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 08:23:42 -04:00

Herald v2 (#74)

* Add speech rate setting

* Add volume slider

* New speech manager skeleton

* User API key from resx

* Implement voice list retrieve via new api

* Rewrite to use ObAPI, remove all dependancies

* Use volume setting

* Clean up using statements

* Volume and timing adjustments

* Lookup rate value

* Use numeric rates for tighter spread

* Manage plugin data folder via core interface

* Add check that nullable settings are not null.

* Get file size before it's deleted.

* Improve old settings migration.

* Ignore cache sizes below 1MB

* Re-index orphaned files in cache, purge legacy wav files.

* Call top level error logging for native voice exception.

* Async title and detail requests to remove pause

* Remove NetCoreAudio use of temp files.

* Remove orphan using.
This commit is contained in:
Jonathan Miller
2022-04-04 11:58:30 -02:30
committed by GitHub
parent 3cc8cc3abe
commit 1950d477fd
19 changed files with 1127 additions and 288 deletions

View File

@ -32,7 +32,14 @@ namespace Observatory.NativeNotification
private async void ProcessQueueAsync()
{
await Task.Factory.StartNew(ProcessQueue);
try
{
await Task.Factory.StartNew(ProcessQueue);
}
catch (System.Exception ex)
{
ObservatoryCore.LogError(ex, " - Native Voice Notifier");
}
}
private void ProcessQueue()

View File

@ -22,15 +22,19 @@ namespace Observatory
}
catch (Exception ex)
{
var docPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
var errorMessage = new System.Text.StringBuilder();
errorMessage
.AppendLine($"Error encountered in Elite Observatory {version}.")
.AppendLine(FormatExceptionMessage(ex))
.AppendLine();
System.IO.File.AppendAllText(docPath + System.IO.Path.DirectorySeparatorChar + "ObservatoryErrorLog.txt", errorMessage.ToString());
LogError(ex, version);
}
}
internal static void LogError(Exception ex, string context)
{
var docPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
var errorMessage = new System.Text.StringBuilder();
errorMessage
.AppendLine($"Error encountered in Elite Observatory {context}.")
.AppendLine(FormatExceptionMessage(ex))
.AppendLine();
System.IO.File.AppendAllText(docPath + System.IO.Path.DirectorySeparatorChar + "ObservatoryErrorLog.txt", errorMessage.ToString());
}
static string FormatExceptionMessage(Exception ex, bool inner = false)

View File

@ -3,6 +3,7 @@ using Observatory.Framework.Files;
using Observatory.Framework.Interfaces;
using Observatory.NativeNotification;
using System;
using System.IO;
namespace Observatory.PluginManagement
{
@ -145,5 +146,21 @@ namespace Observatory.PluginManagement
}
public event EventHandler<NotificationArgs> Notification;
public string PluginStorageFolder
{
get
{
var context = new System.Diagnostics.StackFrame(1).GetMethod();
string folderLocation = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
+ $"{Path.DirectorySeparatorChar}ObservatoryCore{Path.DirectorySeparatorChar}{context.DeclaringType.Assembly.GetName().Name}{Path.DirectorySeparatorChar}";
if (!Directory.Exists(folderLocation))
Directory.CreateDirectory(folderLocation);
return folderLocation;
}
}
}
}