Skip to content

Commit

Permalink
Fix TTS voice name and app auto start
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsumi-sama committed Nov 15, 2023
1 parent ba8144c commit 1787161
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dotnet/AppApi/AppApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ public void IPCAnnounceStart()
{
IPCServer.Send(new IPCPacket
{
Type = "VRCXLaunch"
Type = "VRCXLaunch",
MsgType = "VRCXLaunch"
});
}

Expand Down
21 changes: 16 additions & 5 deletions Dotnet/AutoAppLaunchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Runtime.InteropServices;
using System.Timers;
using NLog;

namespace VRCX
{
Expand All @@ -14,6 +15,7 @@ namespace VRCX
public class AutoAppLaunchManager
{
public static AutoAppLaunchManager Instance { get; private set; }
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public static readonly string VRChatProcessName = "VRChat";

public bool Enabled = false;
Expand Down Expand Up @@ -215,14 +217,23 @@ public static void KillProcessTree(int pid)
/// Starts a new child process.
/// </summary>
/// <param name="path">The path.</param>
internal void StartChildProcess(string path)
private void StartChildProcess(string path)
{
try
{
using (var process = Process.Start(path))
if (process != null)
startedProcesses.Add(path, new HashSet<int>() { process.Id });
} catch { }
var process = new Process();
process.StartInfo = new ProcessStartInfo(path)
{
UseShellExecute = true
};
process.Start();
if (process.Id != 0)
startedProcesses.Add(path, new HashSet<int>() { process.Id });
}
catch (Exception ex)
{
logger.Error(ex);
}
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15260,14 +15260,14 @@ speechSynthesis.getVoices();
}
};

$app.methods.getTTSVoiceName = async function () {
$app.methods.getTTSVoiceName = function () {
var voices = speechSynthesis.getVoices();
if (voices.length === 0) {
return '';
}
if (this.notificationTTSVoice >= voices.length) {
this.notificationTTSVoice = 0;
await configRepository.setString(
configRepository.setString(
'VRCX_notificationTTSVoice',
this.notificationTTSVoice
);
Expand Down

0 comments on commit 1787161

Please sign in to comment.