From 9d819e9f052f670c41250b5ad6b84691a6886c99 Mon Sep 17 00:00:00 2001 From: VRCWizard <101527472+VRCWizard@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:45:06 -0500 Subject: [PATCH 1/2] KAT refactor and improvments --- OSCVRCWiz/Resources/StartUp/Updater.cs | 2 +- .../Heartrate/HeartratePulsoid.cs | 8 +- .../Integrations/Media/SpotifyAddon.cs | 11 +- .../Services/Integrations/OSCListener.cs | 6 +- .../Services/Integrations/VRChatListener.cs | 8 +- OSCVRCWiz/Services/Speech/DoSpeech.cs | 4 +- OSCVRCWiz/Services/Text/OutputText.cs | 1351 +++++++++-------- OSCVRCWiz/VoiceWizardWindow.cs | 6 +- 8 files changed, 725 insertions(+), 671 deletions(-) diff --git a/OSCVRCWiz/Resources/StartUp/Updater.cs b/OSCVRCWiz/Resources/StartUp/Updater.cs index 4838d344..2e33e501 100644 --- a/OSCVRCWiz/Resources/StartUp/Updater.cs +++ b/OSCVRCWiz/Resources/StartUp/Updater.cs @@ -7,7 +7,7 @@ namespace OSCVRCWiz.Resources.StartUp public class Updater { - public static string currentVersion = "1.5.8.1"; + public static string currentVersion = "1.5.8.5"; public static string updateXMLName = "https://github.com/VRCWizard/TTS-Voice-Wizard/releases/latest/download/AutoUpdater-x64.xml"; public static async void getGithubInfo() diff --git a/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs b/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs index c7139c93..15690a82 100644 --- a/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs +++ b/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs @@ -217,6 +217,10 @@ private static async void doHeartrateTimerTick() var message3 = new CoreOSC.OscMessage("/avatar/parameters/hundredsHR", hundreds); OSC.OSCSender.Send(message3); + float HRPercent = currentHR / 256; + var message4 = new CoreOSC.OscMessage("/avatar/parameters/HRPercent", HRPercent); + OSC.OSCSender.Send(message4); + // Debug.WriteLine(currentHR + "--" + HRPrevious); @@ -285,12 +289,12 @@ private static async void doHeartrateTimerTick() } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true) { - OutputText.outputVRChat("Heartrate: " + currentHR.ToString() + " bpm", "bpm"); + OutputText.outputVRChat("Heartrate: " + currentHR.ToString() + " bpm", OutputText.DisplayTextType.HeartRate); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true) { - Task.Run(() => OutputText.outputVRChatSpeechBubbles("💓 " + currentHR.ToString() + " bpm", "bpm")); + Task.Run(() => OutputText.outputVRChatSpeechBubbles("💓 " + currentHR.ToString() + " bpm", OutputText.DisplayTextType.HeartRate)); } diff --git a/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs b/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs index 74726883..4d5ca4c7 100644 --- a/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs +++ b/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs @@ -225,12 +225,12 @@ public static async Task spotifyGetCurrentSongInfo(bool playOnce) if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyKatDisable.Checked == false) { - Task.Run(() => OutputText.outputVRChat(textTime, "spotify")); + Task.Run(() => OutputText.outputVRChat(textTime, OutputText.DisplayTextType.Spotify)); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyChatboxDisable.Checked == false) { // theString = LineBreakerChatbox(theString, 28);//must always be the last - Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, "spotify")); //original + Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, OutputText.DisplayTextType.Spotify)); //original } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOBSText.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonMedia4OBS.Checked == true) @@ -241,6 +241,8 @@ public static async Task spotifyGetCurrentSongInfo(bool playOnce) // lastSong = title; // MainForm.justShowTheSong = false; + SpotifyAddon.lastSong = SpotifyAddon.title; + // WindowsMedia.previousTitle = WindowsMedia.mediaTitle; fullSongPauseCheck = progress; @@ -449,18 +451,19 @@ private static void MediaOutput(string text) if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyKatDisable.Checked == false) { - Task.Run(() => OutputText.outputVRChat(textTime, "spotify")); + Task.Run(() => OutputText.outputVRChat(textTime, OutputText.DisplayTextType.WindowsMedia)); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyChatboxDisable.Checked == false) { // text = LineBreakerChatbox(text, 28);//must always be the last - Task.Run(() => OutputText.outputVRChatSpeechBubbles(text, "media")); //original + Task.Run(() => OutputText.outputVRChatSpeechBubbles(text, OutputText.DisplayTextType.WindowsMedia)); //original } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOBSText.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonMedia4OBS.Checked == true) { OutputText.outputTextFile(text, @"Output\TextOut\OBSText.txt"); } + WindowsMedia.previousTitle = WindowsMedia.mediaTitle; } diff --git a/OSCVRCWiz/Services/Integrations/OSCListener.cs b/OSCVRCWiz/Services/Integrations/OSCListener.cs index 39f9de51..19c21f72 100644 --- a/OSCVRCWiz/Services/Integrations/OSCListener.cs +++ b/OSCVRCWiz/Services/Integrations/OSCListener.cs @@ -397,17 +397,17 @@ public static void OSCRecieveHeartRate() } if (VoiceWizardWindow.MainFormGlobal.rjToggleButton3.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true) { - OutputText.outputVRChat("ぬ" + messageReceived.Arguments[0].ToString() + " bpm", "bpm"); //ぬ means heart emoji + OutputText.outputVRChat("ぬ" + messageReceived.Arguments[0].ToString() + " bpm", OutputText.DisplayTextType.HeartRate); //ぬ means heart emoji } if (VoiceWizardWindow.MainFormGlobal.rjToggleButton3.Checked == false && VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true) { - OutputText.outputVRChat("Heartrate: " + messageReceived.Arguments[0].ToString() + " bpm", "bpm"); //add pack emoji toggle (add emoji selection page + OutputText.outputVRChat("Heartrate: " + messageReceived.Arguments[0].ToString() + " bpm", OutputText.DisplayTextType.HeartRate); //add pack emoji toggle (add emoji selection page } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true) { - Task.Run(() => OutputText.outputVRChatSpeechBubbles("Heartrate: " + messageReceived.Arguments[0].ToString() + " bpm", "bpm")); //original + Task.Run(() => OutputText.outputVRChatSpeechBubbles("Heartrate: " + messageReceived.Arguments[0].ToString() + " bpm", OutputText.DisplayTextType.HeartRate)); //original } diff --git a/OSCVRCWiz/Services/Integrations/VRChatListener.cs b/OSCVRCWiz/Services/Integrations/VRChatListener.cs index 6a63b952..accd0b8f 100644 --- a/OSCVRCWiz/Services/Integrations/VRChatListener.cs +++ b/OSCVRCWiz/Services/Integrations/VRChatListener.cs @@ -219,11 +219,11 @@ private static void doVRCCounterTimerTick() }//////////////////////////////////////////////////// if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true) { - Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, "bpm")); + Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, OutputText.DisplayTextType.Counters)); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true) { - Task.Run(() => OutputText.outputVRChat(theString, "bpm")); + Task.Run(() => OutputText.outputVRChat(theString, OutputText.DisplayTextType.Counters)); } } @@ -287,11 +287,11 @@ private static void doVRCCounterTimerTick() if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true && OSCListener.pauseBPM != true) { - Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, "bpm")); + Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, OutputText.DisplayTextType.Counters)); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true && OSCListener.pauseBPM != true) { - Task.Run(() => OutputText.outputVRChat(theString, "bpm")); + Task.Run(() => OutputText.outputVRChat(theString, OutputText.DisplayTextType.Counters,i)); } } } diff --git a/OSCVRCWiz/Services/Speech/DoSpeech.cs b/OSCVRCWiz/Services/Speech/DoSpeech.cs index 33adf9be..113bece5 100644 --- a/OSCVRCWiz/Services/Speech/DoSpeech.cs +++ b/OSCVRCWiz/Services/Speech/DoSpeech.cs @@ -385,13 +385,13 @@ public static async void MainDoTTS(TTSMessageQueue.TTSMessage TTSMessageQueued) { OSCListener.pauseBPM = true; SpotifyAddon.pauseSpotify = true; - Task.Run(() => OutputText.outputVRChat(writeText, "tts")); + Task.Run(() => OutputText.outputVRChat(writeText, OutputText.DisplayTextType.TextToSpeech)); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonNoTTSChat.Checked == false) { OSCListener.pauseBPM = true; SpotifyAddon.pauseSpotify = true; - Task.Run(() => OutputText.outputVRChatSpeechBubbles(writeText, "tts")); //original + Task.Run(() => OutputText.outputVRChatSpeechBubbles(writeText, OutputText.DisplayTextType.TextToSpeech)); //original } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonQueueSystem.Checked == true && TTSMessageQueued.TTSMode == "No TTS") diff --git a/OSCVRCWiz/Services/Text/OutputText.cs b/OSCVRCWiz/Services/Text/OutputText.cs index 19f3ccb6..cfa83fbc 100644 --- a/OSCVRCWiz/Services/Text/OutputText.cs +++ b/OSCVRCWiz/Services/Text/OutputText.cs @@ -9,12 +9,14 @@ using OSCVRCWiz.Services.Integrations.Media; using OSCVRCWiz.Services.Integrations; using OSCVRCWiz.Resources.StartUp.StartUp; +using Amazon.Polly.Model; +using System.Threading; namespace OSCVRCWiz.Services.Text { public class OutputText { - static string previousRequestType = ""; + static DisplayTextType previousRequestType = DisplayTextType.None; bool currentlyPrinting = false; static DateTime lastDateTime = DateTime.Now; public static string lastKatString = ""; @@ -22,8 +24,25 @@ public class OutputText public static int debugDelayValue = Convert.ToInt32(Settings1.Default.delayDebugValueSetting);// Recommended delay of 250ms //this is the first call i see now public static int eraseDelay = Convert.ToInt32(Settings1.Default.hideDelayValue); public static bool EraserRunning = false; + public static string lastRememberedSong; + public static int lastStringPoint = 1; + public static int lastCounter; + // static CancellationTokenSource cts = new(); + public enum DisplayTextType + { + None, + TextToText, + TextToSpeech, + HeartRate, + Counters, + Time, + WindowsMedia, + Spotify, + UpdateText, + RepeatText + } public static void loadTextDelays() @@ -116,7 +135,7 @@ public static async void outputTextFile(string textstring, string filepath) } } - public static async void outputVRChatSpeechBubbles(string textstring, string type) + public static async void outputVRChatSpeechBubbles(string textstring, DisplayTextType type) { try { @@ -129,7 +148,7 @@ public static async void outputVRChatSpeechBubbles(string textstring, string typ System.Diagnostics.Debug.WriteLine("Encoded UTF-8: " + textstring); - var typingbubble = new OscMessage("/chatbox/typing", false);//this is turned on as soon as you press the STTTS button and turned off here + var typingbubbleOff = new OscMessage("/chatbox/typing", false);//this is turned on as soon as you press the STTTS button and turned off here var messageSpeechBubble = new OscMessage("/chatbox/input", textstring, true, false); // var messageSpeechBubble = new SharpOSC.OscMessage("/chatbox/input", textstring); //testing if error message appears /what value is defaulted to if not specified @@ -138,7 +157,7 @@ public static async void outputVRChatSpeechBubbles(string textstring, string typ messageSpeechBubble = new OscMessage("/chatbox/input", textstring, false, false); } - if (type == "tts" && VoiceWizardWindow.MainFormGlobal.rjToggleSoundNotification.Checked == true) //handles sound notification output so it is only sent for TTS messages (i dont know how annoying this will be) //also if message is not tts keyboard can not be shown + if (type == DisplayTextType.TextToSpeech && VoiceWizardWindow.MainFormGlobal.rjToggleSoundNotification.Checked == true) //handles sound notification output so it is only sent for TTS messages (i dont know how annoying this will be) //also if message is not tts keyboard can not be shown { messageSpeechBubble = new OscMessage("/chatbox/input", textstring, true, true); @@ -147,9 +166,9 @@ public static async void outputVRChatSpeechBubbles(string textstring, string typ messageSpeechBubble = new OscMessage("/chatbox/input", textstring, false, true); } } - if (type != "spotify" && type != "bpm" && type != "media")// so in otherowrds if type is tts it disables typing indicator + if (type == DisplayTextType.TextToSpeech)// so in otherowrds if type is tts it disables typing indicator { - OSC.OSCSender.Send(typingbubble); + OSC.OSCSender.Send(typingbubbleOff); } OSC.OSCSender.Send(messageSpeechBubble); @@ -158,7 +177,7 @@ public static async void outputVRChatSpeechBubbles(string textstring, string typ hideTimer.Change(eraseDelay, 0); } - if (type == "spotify") + if (type == DisplayTextType.WindowsMedia|| type == DisplayTextType.Spotify) { if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == false || VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyKatDisable.Checked == true) //the fix, this needs to activate when ever KAT DOESNT OUTPUT, which also happens if disable spotify output for kat is enabled @@ -170,7 +189,7 @@ public static async void outputVRChatSpeechBubbles(string textstring, string typ } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonHideDelay2.Checked) //inactive hide { - if (type == "bpm") + if (type == DisplayTextType.HeartRate || type == DisplayTextType.Counters || type == DisplayTextType.Time) { SpotifyAddon.pauseSpotify = true; //this is for when using counters or bpm i guess too, it makes them pause spotify(media output) @@ -196,22 +215,73 @@ public static async void outputVRChatSpeechBubbles(string textstring, string typ } - public static async void outputVRChat(string textstringbefore, string type) + public static async void outputVRChat(string textstringbefore, DisplayTextType type, int counterNum = 0) { try { - if (type == "tts" || type == "tttAdd") + // cts.Cancel(); + // cts = new(); + float letter = 0.0F; + int charCounter = 0; + int stringPoint = 1; + + + float letterFloat0 = 0; + float letterFloat1 = 0; + float letterFloat2 = 0; + float letterFloat3 = 0; + float letterFloat4 = 0; + float letterFloat5 = 0; + float letterFloat6 = 0; + float letterFloat7 = 0; + + float letterFloat8 = 0; //16 mode + float letterFloat9 = 0;//16 mode + float letterFloat10 = 0;//16 mode + float letterFloat11 = 0;//16 mode + float letterFloat12 = 0;//16 mode + float letterFloat13 = 0;//16 mode + float letterFloat14 = 0;//16 mode + float letterFloat15 = 0;//16 mode + + var OSCMakeKatVisible = new OscMessage("/avatar/parameters/KAT_Visible", true); + var OSCClearKatEraseAll = new OscMessage("/avatar/parameters/KAT_Pointer", 255); + var OSCCurrentkatPointer = new OscMessage("/avatar/parameters/KAT_Pointer", 1); + var Char0 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); + var Char1 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); + var Char2 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); + var Char3 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); + + var Char4 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4); + var Char5 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5); + var Char6 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6); + var Char7 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7); + + var Char8 = new OscMessage("/avatar/parameters/KAT_CharSync8", letterFloat8); + var Char9 = new OscMessage("/avatar/parameters/KAT_CharSync9", letterFloat9); + var Char10 = new OscMessage("/avatar/parameters/KAT_CharSync10", letterFloat10); + var Char11 = new OscMessage("/avatar/parameters/KAT_CharSync11", letterFloat11); + var Char12 = new OscMessage("/avatar/parameters/KAT_CharSync12", letterFloat12); + var Char13 = new OscMessage("/avatar/parameters/KAT_CharSync13", letterFloat13); + var Char14 = new OscMessage("/avatar/parameters/KAT_CharSync14", letterFloat14); + var Char15 = new OscMessage("/avatar/parameters/KAT_CharSync15", letterFloat15); + + + + + if (type == DisplayTextType.TextToSpeech || type == DisplayTextType.UpdateText)//remember last message { lastKatString = textstringbefore; } - var message0 = new OscMessage("/avatar/parameters/KAT_Visible", true); + - if (type != "tttAdd")// if adding then tttadd should already be visible + if (type != DisplayTextType.UpdateText)// if adding then tttadd should already be visible { - OSC.OSCSender.Send(message0); + OSC.OSCSender.Send(OSCMakeKatVisible); } + //if emojis if (VoiceWizardWindow.MainFormGlobal.rjToggleButton3.Checked == true) { textstringbefore = EmojiAddon.DoEmojiReplacement(textstringbefore); @@ -223,608 +293,122 @@ public static async void outputVRChat(string textstringbefore, string type) System.Diagnostics.Debug.WriteLine("*KAT String Splitting*"); - int lineSplitLength = 32; - VoiceWizardWindow.MainFormGlobal.Invoke((MethodInvoker)delegate () { lineSplitLength = Int32.Parse(VoiceWizardWindow.MainFormGlobal.KATLineLengthTextBox.Text); - }); + //pre-process input string + string textstring = SplitToLines(textstringbefore, lineSplitLength);//prevent line cut off + textstring = ParameterSyncSpacing(textstring); - string textstring = SplitToLines(textstringbefore, lineSplitLength); + - // System.Diagnostics.Debug.WriteLine("perfectString= " + textstring); - // System.Diagnostics.Debug.WriteLine("broken lines=========================================================="); - //textstring = textstring.ToLower(); // no more lowercase - int stringleng = 0; - foreach (char h in textstring) + /* if ((DateTime.Now - lastDateTime).Seconds <= 1)//collision prevention { - stringleng += 1; + Task.Delay(1555).Wait(); } - //System.Diagnostics.Debug.WriteLine("textstring length =" + textstring.Length); + lastDateTime = DateTime.Now;*/ - int sentenceLength = stringleng % 16; - switch (sentenceLength) + switch (type) { - case 1: - textstring += " "; - if (numKATSyncParameters == "8" || numKATSyncParameters == "16") - { - textstring += " "; - }; - if (numKATSyncParameters == "16") - { - textstring += " "; - }; - break; - - case 2: - textstring += " "; - if (numKATSyncParameters == "8" || numKATSyncParameters == "16") - { - textstring += " "; - } - if (numKATSyncParameters == "16") - { - textstring += " "; - }; - break; - case 3: - textstring += " "; - if (numKATSyncParameters == "8" || numKATSyncParameters == "16") - { - textstring += " "; - } - if (numKATSyncParameters == "16") + case DisplayTextType.HeartRate: + if (previousRequestType == DisplayTextType.HeartRate) { - textstring += " "; + //Task.Delay(50).Wait(); } - break; - case 4: - textstring += ""; - if (numKATSyncParameters == "8" || numKATSyncParameters == "16") - { - textstring += " "; - } - if (numKATSyncParameters == "16") + else { - textstring += " "; + OSC.OSCSender.Send(OSCClearKatEraseAll); } break; - case 5: - textstring += " "; - if (numKATSyncParameters == "16") - { - textstring += " "; - }; break; - case 6: - textstring += " "; - if (numKATSyncParameters == "16") - { - textstring += " "; - }; break; - case 7: - textstring += " "; - if (numKATSyncParameters == "16") - { - textstring += " "; - }; break; - case 8: textstring += " "; break; //16 mode - case 9: textstring += " "; break; //16 mode - case 10: textstring += " "; break; //16 mode - case 11: textstring += " "; break; //16 mode - case 12: textstring += " "; break; //16 mode - case 13: textstring += " "; break; //16 mode - case 14: textstring += " "; break; //16 mode - case 15: textstring += " "; break; //16 mode - default:; break; - } - - float letter = 0.0F; - int charCounter = 0; - int stringPoint = 1; - - - float letterFloat0 = 0; - float letterFloat1 = 0; - float letterFloat2 = 0; - float letterFloat3 = 0; - float letterFloat4 = 0; - float letterFloat5 = 0; - float letterFloat6 = 0; - float letterFloat7 = 0; - - float letterFloat8 = 0; //16 mode - float letterFloat9 = 0;//16 mode - float letterFloat10 = 0;//16 mode - float letterFloat11 = 0;//16 mode - float letterFloat12 = 0;//16 mode - float letterFloat13 = 0;//16 mode - float letterFloat14 = 0;//16 mode - float letterFloat15 = 0;//16 mode - - var message1 = new OscMessage("/avatar/parameters/KAT_Pointer", 255); - var message2 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); - var message3 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); - var message4 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); - var message5 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); - var message6 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4); - var message7 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5); - var message8 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6); - var message9 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7); - - var message10 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat8); - var message11 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat9); - var message12 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat10); - var message13 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat11); - var message14 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat12); - var message15 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat13); - var message16 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat14); - var message17 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat15); - - - // var message0 = new SharpOSC.OscMessage("/avatar/parameters/KAT_Visible", true); - - - // string testingthis = (DateTime.Now - lastDateTime).ToString("ss"); - - // ot.outputLog(MainForm, testingthis); - - - if ((DateTime.Now - lastDateTime).Seconds <= 1) - { - // var ot = new OutputText(); - // ot.outputLog(MainForm, "collision"); - - Task.Delay(1555).Wait(); - } - lastDateTime = DateTime.Now; - - switch (type) - { - case "bpm": - if (previousRequestType == "bpm") + case DisplayTextType.Counters: + if (previousRequestType == DisplayTextType.Counters) { - System.Diagnostics.Debug.WriteLine("bpm case ran"); - Task.Delay(50).Wait(); + // Task.Delay(50).Wait(); + if(lastCounter != counterNum) + { + OSC.OSCSender.Send(OSCClearKatEraseAll); + } } else { - OSC.OSCSender.Send(message1); + if ((DateTime.Now - lastDateTime).Seconds <= 1)//collision prevention + { + Task.Delay(debugDelayValue * lastStringPoint).Wait(); + } + OSC.OSCSender.Send(OSCClearKatEraseAll); } break; - case "spotify": + case DisplayTextType.WindowsMedia: - if (previousRequestType == "spotify") + if (previousRequestType == DisplayTextType.WindowsMedia) { - if (SpotifyAddon.title == SpotifyAddon.lastSong) + if (WindowsMedia.mediaTitle != lastRememberedSong) { - System.Diagnostics.Debug.WriteLine("spotify case ran"); - // Task.Delay(50).Wait(); - // MainForm.sender3.Send(message1);//remove after testing + // Task.Delay(500).Wait(); + OSC.OSCSender.Send(OSCClearKatEraseAll); } - else - { - Task.Delay(50).Wait(); - OSC.OSCSender.Send(message1); - } - if (WindowsMedia.previousTitle == WindowsMedia.mediaTitle) - { - System.Diagnostics.Debug.WriteLine("spotify case ran"); - //Task.Delay(50).Wait(); - // MainForm.sender3.Send(message1);//remove after testing - } - else + + } + lastRememberedSong = WindowsMedia.mediaTitle; + break; + case DisplayTextType.Spotify: + + if (previousRequestType == DisplayTextType.Spotify) + { + if (SpotifyAddon.title != lastRememberedSong) { - Task.Delay(100).Wait(); - OSC.OSCSender.Send(message1); + // Task.Delay(500).Wait(); + OSC.OSCSender.Send(OSCClearKatEraseAll); } } - else + lastRememberedSong = SpotifyAddon.title; + break; + case DisplayTextType.TextToSpeech://dont clear all + if ((DateTime.Now - lastDateTime).Seconds <= 1)//collision prevention { - OSC.OSCSender.Send(message1); + Task.Delay(debugDelayValue * lastStringPoint).Wait(); } - SpotifyAddon.lastSong = SpotifyAddon.title; - WindowsMedia.previousTitle = WindowsMedia.mediaTitle; + + OSC.OSCSender.Send(OSCClearKatEraseAll); + + break; + case DisplayTextType.UpdateText://dont clear all + break; + case DisplayTextType.RepeatText: //dont clear all break; - case "tttAdd": break; - case "tttRefresh": break; default: - OSC.OSCSender.Send(message1); + OSC.OSCSender.Send(OSCClearKatEraseAll); break; } - - + lastDateTime = DateTime.Now; previousRequestType = type; - // Task.Delay(50).Wait(); // this delay is to fix text box showing your previous message for a brief second (turned off for now because hide text replaced with clear text) - // MainForm.sender3.Send(message0); - - - message1 = new OscMessage("/avatar/parameters/KAT_Pointer", 1); + foreach (char c in textstring) { - switch (c) - { - case ' ': letter = 0; break; - case '!': letter = 1; break; - case '\"': letter = 2; break; - case '#': letter = 3; break; - case '$': letter = 4; break; - case '%': letter = 5; break; - case '&': letter = 6; break; - case '\'': letter = 7; break; - case '(': letter = 8; break; - case ')': letter = 9; break; - - case '*': letter = 10; break; - case '+': letter = 11; break; - case ',': letter = 12; break; - case '-': letter = 13; break; - case '.': letter = 14; break; - case '/': letter = 15; break; - case '0': letter = 16; break; - case '1': letter = 17; break; - case '2': letter = 18; break; - case '3': letter = 19; break; - - case '4': letter = 20; break; - case '5': letter = 21; break; - case '6': letter = 22; break; - case '7': letter = 23; break; - case '8': letter = 24; break; - case '9': letter = 25; break; - case ':': letter = 26; break; - case ';': letter = 27; break; - case '<': letter = 28; break; - case '=': letter = 29; break; - - case '>': letter = 30; break; - case '?': letter = 31; break; - case '@': letter = 32; break; - case 'A': letter = 33; break; - case 'B': letter = 34; break; - case 'C': letter = 35; break; - case 'D': letter = 36; break; - case 'E': letter = 37; break; - case 'F': letter = 38; break; - case 'G': letter = 39; break; - - case 'H': letter = 40; break; - case 'I': letter = 41; break; - case 'J': letter = 42; break; - case 'K': letter = 43; break; - case 'L': letter = 44; break; - case 'M': letter = 45; break; - case 'N': letter = 46; break; - case 'O': letter = 47; break; - case 'P': letter = 48; break; - case 'Q': letter = 49; break; - - case 'R': letter = 50; break; - case 'S': letter = 51; break; - case 'T': letter = 52; break; - case 'U': letter = 53; break; - case 'V': letter = 54; break; - case 'W': letter = 55; break; - case 'X': letter = 56; break; - case 'Y': letter = 57; break; - case 'Z': letter = 58; break; - case '[': letter = 59; break; - - case '\\': letter = 60; break; - case ']': letter = 61; break; - case '^': letter = 62; break; - case '_': letter = 63; break; - case '`': letter = 64; break; - case 'a': letter = 65; break; - case 'b': letter = 66; break; - case 'c': letter = 67; break; - case 'd': letter = 68; break; - case 'e': letter = 69; break; - - case 'f': letter = 70; break; - case 'g': letter = 71; break; - case 'h': letter = 72; break; - case 'i': letter = 73; break; - case 'j': letter = 74; break; - case 'k': letter = 75; break; - case 'l': letter = 76; break; - case 'm': letter = 77; break; - case 'n': letter = 78; break; - case 'o': letter = 79; break; - - case 'p': letter = 80; break; - case 'q': letter = 81; break; - case 'r': letter = 82; break; - case 's': letter = 83; break; - case 't': letter = 84; break; - case 'u': letter = 85; break; - case 'v': letter = 86; break; - case 'w': letter = 87; break; - case 'x': letter = 88; break; - case 'y': letter = 89; break; - - case 'z': letter = 90; break; - case '{': letter = 91; break; - case '|': letter = 92; break; - case '}': letter = 93; break; - case '~': letter = 94; break; - case '€': letter = 95; break; - - /// case '非': letter = 96; break;//trying to map - // case '常': letter = 97; break;//trying to map - // case '': letter = 98; break; - //case '': letter = 99; break; - - //case '': letter = 100; break; - //case '': letter = 101; break; - //case '': letter = 102; break; - //case '': letter = 103; break; - //case '': letter = 104; break; - //case '': letter = 105; break; - //case '': letter = 106; break; - //case '': letter = 107; break; - //case '': letter = 108; break; - // case '': letter = 109; break; - - // case '': letter = 110; break; - // case '': letter = 111; break; - //case '': letter = 112; break; - // case '': letter = 113; break; - // case '': letter = 114; break; - // case '': letter = 115; break; - // case '': letter = 116; break; - //case '': letter = 117; break; - //case '': letter = 118; break; - // case '': letter = 119; break; - - // case '': letter = 120; break; - // case '': letter = 121; break; - //case '': letter = 122; break; - //case '': letter = 123; break; - // case '': letter = 124; break; - // case '': letter = 125; break; - // case '': letter = 126; break; - case 'ぬ': letter = 127; break; //used as heart emoji - //case '': letter = 128; break; - case 'ふ': letter = 129; break; //used as spotify emoji - - case 'あ': letter = 130; break;//emoji 1 - case 'う': letter = 131; break;//emoji 1 - case 'え': letter = 132; break;//emoji 2 - case 'お': letter = 133; break;//emoji 2 - case 'や': letter = 134; break;//emoji 3 - case 'ゆ': letter = 135; break;//emoji 3 - case 'よ': letter = 136; break;//emoji 4 - case 'わ': letter = 137; break;//emoji 4 - case 'を': letter = 138; break;//emoji 5 - case 'ほ': letter = 139; break;//emoji 5 - - case 'へ': letter = 140; break;//emoji 6 - case 'た': letter = 141; break;//emoji 6 - case 'て': letter = 142; break;//emoji 7 - case 'い': letter = 143; break;//emoji 7 - case 'す': letter = 144; break;//emoji 8 - case 'か': letter = 145; break;//emoji 8 - case 'ん': letter = 146; break;//emoji 9 - case 'な': letter = 147; break;//emoji 9 - case 'に': letter = 148; break;//emoji 10 - case 'ら': letter = 149; break;//emoji 10 - - case 'せ': letter = 150; break;//11 - case 'ち': letter = 151; break;//11 - case 'と': letter = 152; break;//12 - case 'し': letter = 153; break;//12 - case 'は': letter = 154; break;//13 - case 'き': letter = 155; break;//13 - case 'く': letter = 156; break;//14 - case 'ま': letter = 157; break;//14 - case 'の': letter = 158; break;//15 - case 'り': letter = 159; break;//15 - - case 'れ': letter = 160; break;//16 - case 'け': letter = 161; break;//16 - case 'む': letter = 162; break;//17 - case 'つ': letter = 163; break;//17 - case 'さ': letter = 164; break;//18 - case 'そ': letter = 165; break;//18 - case 'ひ': letter = 166; break;//19 - case 'こ': letter = 167; break;//19 - case 'み': letter = 168; break;//20 - case 'も': letter = 169; break;//20 - - case 'ね': letter = 170; break; - case 'る': letter = 171; break; - case 'め': letter = 172; break; - case 'ろ': letter = 173; break; - case '。': letter = 174; break; - case 'ぶ': letter = 175; break; - case 'ぷ': letter = 176; break; - case 'ぼ': letter = 177; break; - case 'ぽ': letter = 178; break; - case 'べ': letter = 179; break;//25 - - case 'ぺ': letter = 180; break; - case 'だ': letter = 181; break; - case 'で': letter = 182; break; - case 'ず': letter = 183; break; - case 'が': letter = 184; break; - case 'ぜ': letter = 185; break; - case 'ぢ': letter = 186; break; - case 'ど': letter = 187; break; - case 'じ': letter = 188; break; - case 'ば': letter = 189; break;//30 - - case 'ぱ': letter = 190; break; - case 'ぎ': letter = 191; break; - case 'ぐ': letter = 192; break; - case 'げ': letter = 193; break; - case 'づ': letter = 194; break; - case 'ざ': letter = 195; break; - case 'ぞ': letter = 196; break; - case 'び': letter = 197; break; - case 'ぴ': letter = 198; break; - case 'ご': letter = 199; break;//35 - - case 'ぁ': letter = 200; break; - case 'ぃ': letter = 201; break; - case 'ぅ': letter = 202; break; - case 'ぇ': letter = 203; break; - case 'ぉ': letter = 204; break; - case 'ゃ': letter = 205; break; - case 'ゅ': letter = 206; break; - case 'ょ': letter = 207; break; - case 'ヌ': letter = 208; break; - case 'フ': letter = 209; break;//40 - - case 'ア': letter = 210; break; - case 'ウ': letter = 211; break; - case 'エ': letter = 212; break; - case 'オ': letter = 213; break; - case 'ヤ': letter = 214; break; - case 'ユ': letter = 215; break; - case 'ヨ': letter = 216; break; - case 'ワ': letter = 217; break; - case 'ヲ': letter = 218; break; - case 'ホ': letter = 219; break;//45 - - case 'ヘ': letter = 220; break; - case 'タ': letter = 221; break; - case 'テ': letter = 222; break; - case 'イ': letter = 223; break; - case 'ス': letter = 224; break; - case 'カ': letter = 225; break; - case 'ン': letter = 226; break; - case 'ナ': letter = 227; break; - case 'ニ': letter = 228; break; - case 'ラ': letter = 229; break;//50 - - case 'セ': letter = 230; break; - case 'チ': letter = 231; break; - case 'ト': letter = 232; break; - case 'シ': letter = 233; break; - case 'ハ': letter = 234; break; - case 'キ': letter = 235; break; - case 'ク': letter = 236; break; - case 'マ': letter = 237; break; - case 'ノ': letter = 238; break; - case 'リ': letter = 239; break;//55 - - case 'レ': letter = 240; break; - case 'ケ': letter = 241; break; - case 'ム': letter = 242; break; - case 'ツ': letter = 243; break; - case 'サ': letter = 244; break; - case 'ソ': letter = 245; break; - case 'ヒ': letter = 246; break; - case 'コ': letter = 247; break; - case 'ミ': letter = 248; break; - case 'モ': letter = 249; break;//60 - - case 'ネ': letter = 250; break; - case 'ル': letter = 251; break; - case 'メ': letter = 252; break; - case 'ロ': letter = 253; break; - case '〝': letter = 254; break; - case '°': letter = 255; break;//63 - - - case '¿': letter = 31; break; - - case 'À': letter = 33; break; - case 'Á': letter = 33; break; - case 'Â': letter = 33; break; - case 'Ã': letter = 33; break; - case 'Ä': letter = 33; break; - case 'Å': letter = 33; break; - case 'Æ': letter = 33; break; - - case 'à': letter = 65; break; - case 'á': letter = 65; break; - case 'â': letter = 65; break; - case 'ã': letter = 65; break; - case 'ä': letter = 65; break; - case 'å': letter = 65; break; - case 'æ': letter = 65; break; - - case 'È': letter = 37; break; - case 'É': letter = 37; break; - case 'Ê': letter = 37; break; - case 'Ë': letter = 37; break; - - case 'è': letter = 69; break; - case 'é': letter = 69; break; - case 'ê': letter = 69; break; - case 'ë': letter = 69; break; - - - case 'Ì': letter = 41; break; - case 'Í': letter = 41; break; - case 'Î': letter = 41; break; - case 'Ï': letter = 41; break; - - case 'ì': letter = 73; break; - case 'í': letter = 73; break; - case 'î': letter = 73; break; - case 'ï': letter = 73; break; - - case 'Ñ': letter = 46; break; - case 'ñ': letter = 78; break; - - - case 'Ò': letter = 47; break; - case 'Ó': letter = 47; break; - case 'Ô': letter = 47; break; - case 'Õ': letter = 47; break; - case 'Ö': letter = 47; break; - - case 'ò': letter = 79; break; - case 'ó': letter = 79; break; - case 'ô': letter = 79; break; - case 'õ': letter = 79; break; - case 'ö': letter = 79; break; - - - default: letter = 31; break; - - - - - - - } - // 7display send letter (no implemented) - // var messageDislay7 = new SharpOSC.OscMessage("/avatar/parameters/7Display", letter); - // MainForm.sender3.Send(messageDislay7); - //var messageDislay7Enter = new SharpOSC.OscMessage("/avatar/parameters/7Display", 10); - // MainForm.sender3.Send(messageDislay7Enter); - - - - if (letter > 127.5) - { - letter = letter - 256; - - } - letter = letter / 127; + // if (!cts.Token.IsCancellationRequested) + // { + letter = GetLetterID(c); switch (charCounter) { + + case 0: letterFloat0 = letter; break; @@ -839,19 +423,22 @@ public static async void outputVRChat(string textstringbefore, string type) { Task.Delay(debugDelayValue).Wait(); letterFloat3 = letter; - message1 = new OscMessage("/avatar/parameters/KAT_Pointer", stringPoint); - message2 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); - message3 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); - message4 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); - message5 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); - message0 = new OscMessage("/avatar/parameters/KAT_Visible", true); - OSC.OSCSender.Send(message1); - OSC.OSCSender.Send(message2); - OSC.OSCSender.Send(message3); - OSC.OSCSender.Send(message4); - OSC.OSCSender.Send(message5); - OSC.OSCSender.Send(message0); + + OSCCurrentkatPointer = new OscMessage("/avatar/parameters/KAT_Pointer", stringPoint); + Char0 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); + Char1 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); + Char2 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); + Char3 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); + OSCMakeKatVisible = new OscMessage("/avatar/parameters/KAT_Visible", true); + + + OSC.OSCSender.Send(OSCCurrentkatPointer); + OSC.OSCSender.Send(Char0); + OSC.OSCSender.Send(Char1); + OSC.OSCSender.Send(Char2); + OSC.OSCSender.Send(Char3); + OSC.OSCSender.Send(OSCMakeKatVisible); stringPoint += 1; @@ -883,31 +470,35 @@ public static async void outputVRChat(string textstringbefore, string type) { Task.Delay(debugDelayValue).Wait(); letterFloat7 = letter; - message1 = new OscMessage("/avatar/parameters/KAT_Pointer", stringPoint); - message2 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); - message3 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); - message4 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); - message5 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); - message6 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4); - message7 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5); - message8 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6); - message9 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7); - message0 = new OscMessage("/avatar/parameters/KAT_Visible", true); - OSC.OSCSender.Send(message1); - OSC.OSCSender.Send(message2); - OSC.OSCSender.Send(message3); - OSC.OSCSender.Send(message4); - OSC.OSCSender.Send(message5); + OSCCurrentkatPointer = new OscMessage("/avatar/parameters/KAT_Pointer", stringPoint); + Char0 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); + Char1 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); + Char2 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); + Char3 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); + + Char4 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4); + Char5 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5); + Char6 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6); + Char7 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7); + OSCMakeKatVisible = new OscMessage("/avatar/parameters/KAT_Visible", true); + - OSC.OSCSender.Send(message6); - OSC.OSCSender.Send(message7); - OSC.OSCSender.Send(message8); - OSC.OSCSender.Send(message9); - OSC.OSCSender.Send(message0); + OSC.OSCSender.Send(OSCCurrentkatPointer); + OSC.OSCSender.Send(Char0); + OSC.OSCSender.Send(Char1); + OSC.OSCSender.Send(Char2); + OSC.OSCSender.Send(Char3); + + OSC.OSCSender.Send(Char4); + OSC.OSCSender.Send(Char5); + OSC.OSCSender.Send(Char6); + OSC.OSCSender.Send(Char7); + + OSC.OSCSender.Send(OSCMakeKatVisible); stringPoint += 1; @@ -951,53 +542,58 @@ public static async void outputVRChat(string textstringbefore, string type) letterFloat14 = letter; break; case 15: - Task.Delay(debugDelayValue).Wait(); letterFloat15 = letter; - message1 = new OscMessage("/avatar/parameters/KAT_Pointer", stringPoint); - message2 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); - message3 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); - message4 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); - message5 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); + Task.Delay(debugDelayValue).Wait(); + + OSCCurrentkatPointer = new OscMessage("/avatar/parameters/KAT_Pointer", stringPoint); + + Char0 = new OscMessage("/avatar/parameters/KAT_CharSync0", letterFloat0); + Char1 = new OscMessage("/avatar/parameters/KAT_CharSync1", letterFloat1); + Char2 = new OscMessage("/avatar/parameters/KAT_CharSync2", letterFloat2); + Char3 = new OscMessage("/avatar/parameters/KAT_CharSync3", letterFloat3); - message6 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4); - message7 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5); - message8 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6); - message9 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7); + Char4 = new OscMessage("/avatar/parameters/KAT_CharSync4", letterFloat4); + Char5 = new OscMessage("/avatar/parameters/KAT_CharSync5", letterFloat5); + Char6 = new OscMessage("/avatar/parameters/KAT_CharSync6", letterFloat6); + Char7 = new OscMessage("/avatar/parameters/KAT_CharSync7", letterFloat7); - message10 = new OscMessage("/avatar/parameters/KAT_CharSync8", letterFloat8); - message11 = new OscMessage("/avatar/parameters/KAT_CharSync9", letterFloat9); - message12 = new OscMessage("/avatar/parameters/KAT_CharSync10", letterFloat10); - message13 = new OscMessage("/avatar/parameters/KAT_CharSync11", letterFloat11); + Char8 = new OscMessage("/avatar/parameters/KAT_CharSync8", letterFloat8); + Char9 = new OscMessage("/avatar/parameters/KAT_CharSync9", letterFloat9); + Char10 = new OscMessage("/avatar/parameters/KAT_CharSync10", letterFloat10); + Char11 = new OscMessage("/avatar/parameters/KAT_CharSync11", letterFloat11); - message14 = new OscMessage("/avatar/parameters/KAT_CharSync12", letterFloat12); - message15 = new OscMessage("/avatar/parameters/KAT_CharSync13", letterFloat13); - message16 = new OscMessage("/avatar/parameters/KAT_CharSync14", letterFloat14); - message17 = new OscMessage("/avatar/parameters/KAT_CharSync15", letterFloat15); - message0 = new OscMessage("/avatar/parameters/KAT_Visible", true); + Char12 = new OscMessage("/avatar/parameters/KAT_CharSync12", letterFloat12); + Char13 = new OscMessage("/avatar/parameters/KAT_CharSync13", letterFloat13); + Char14 = new OscMessage("/avatar/parameters/KAT_CharSync14", letterFloat14); + Char15 = new OscMessage("/avatar/parameters/KAT_CharSync15", letterFloat15); + OSCMakeKatVisible = new OscMessage("/avatar/parameters/KAT_Visible", true); - OSC.OSCSender.Send(message1); - OSC.OSCSender.Send(message2); - OSC.OSCSender.Send(message3); - OSC.OSCSender.Send(message4); - OSC.OSCSender.Send(message5); - OSC.OSCSender.Send(message6); - OSC.OSCSender.Send(message7); - OSC.OSCSender.Send(message8); - OSC.OSCSender.Send(message9); - OSC.OSCSender.Send(message10); - OSC.OSCSender.Send(message11); - OSC.OSCSender.Send(message12); - OSC.OSCSender.Send(message13); - OSC.OSCSender.Send(message14); - OSC.OSCSender.Send(message15); - OSC.OSCSender.Send(message16); - OSC.OSCSender.Send(message17); + OSC.OSCSender.Send(OSCCurrentkatPointer); - OSC.OSCSender.Send(message0); + OSC.OSCSender.Send(Char0); + OSC.OSCSender.Send(Char1); + OSC.OSCSender.Send(Char2); + OSC.OSCSender.Send(Char3); + + OSC.OSCSender.Send(Char4); + OSC.OSCSender.Send(Char5); + OSC.OSCSender.Send(Char6); + OSC.OSCSender.Send(Char7); + + OSC.OSCSender.Send(Char8); + OSC.OSCSender.Send(Char9); + OSC.OSCSender.Send(Char10); + OSC.OSCSender.Send(Char11); + OSC.OSCSender.Send(Char12); + OSC.OSCSender.Send(Char13); + OSC.OSCSender.Send(Char14); + OSC.OSCSender.Send(Char15); + + OSC.OSCSender.Send(OSCMakeKatVisible); stringPoint += 1; @@ -1024,39 +620,36 @@ public static async void outputVRChat(string textstringbefore, string type) break; default: break; - } + } - charCounter += 1; - // currentlyPrinting = true; + charCounter += 1; + // currentlyPrinting = true; - if (stringPoint >= 33) - { - break; + if (stringPoint >= 33) + { + break; - } + } + // } } + lastStringPoint = stringPoint; - if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonHideDelay2.Checked && type != "tttRefresh") //inactive hide + if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonHideDelay2.Checked && type != DisplayTextType.RepeatText) //inactive hide { //make timer function start here or be reset here System.Diagnostics.Debug.WriteLine("Outputing text to vrchat finished. Begun scheduled hide text timer"); + if (type == DisplayTextType.HeartRate || type == DisplayTextType.Counters || type == DisplayTextType.Time) + { + SpotifyAddon.pauseSpotify = true; + //this is for when using counters or bpm i guess too, it makes them pause spotify(media output) + } - // System.Diagnostics.Debug.WriteLine("Begun scheduled hide text"); - // System.Diagnostics.Debug.WriteLine("restart/start timer"); - hideTimer.Change(eraseDelay, 0); + hideTimer.Change(eraseDelay, 0); EraserRunning = true; - - // for (int i = 0; i < 5; i++) - // { - // OutputText.outputVRChat(OutputText.lastKatString, "tttAdd"); - - // } - - } else { @@ -1068,7 +661,7 @@ public static async void outputVRChat(string textstringbefore, string type) if (EraserRunning == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonAutoRefreshKAT.Checked == true) { Task.Delay(2000).Wait(); - outputVRChat(lastKatString, "tttRefresh"); + outputVRChat(lastKatString, DisplayTextType.RepeatText); } } @@ -1189,7 +782,7 @@ private static void doTypeTimerTick()//Send Typing Parameter to VRChat { OSCListener.pauseBPM = true; SpotifyAddon.pauseSpotify = true; - Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, "ttt")); //original + Task.Run(() => OutputText.outputVRChatSpeechBubbles(theString, DisplayTextType.TextToText)); //original } @@ -1197,7 +790,7 @@ private static void doTypeTimerTick()//Send Typing Parameter to VRChat { OSCListener.pauseBPM = true; SpotifyAddon.pauseSpotify = true; - Task.Run(() => OutputText.outputVRChat(theString, "tttAdd")); //original + Task.Run(() => OutputText.outputVRChat(theString, DisplayTextType.UpdateText)); //original } } typingBox = false; @@ -1219,7 +812,7 @@ private static void doKatRefreshTimerTick() { if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true) { - OutputText.outputVRChat(OutputText.lastKatString, "tttAdd"); + OutputText.outputVRChat(OutputText.lastKatString, DisplayTextType.UpdateText); } @@ -1244,6 +837,460 @@ public static void EmptyTextOutput() } } + public static string ParameterSyncSpacing(string textstring) + { + int stringleng = 0; + foreach (char h in textstring) + { + stringleng += 1; + } + + int sentenceLength = stringleng % 16; + + switch (sentenceLength) + { + case 1: + textstring += " "; + if (numKATSyncParameters == "8" || numKATSyncParameters == "16") + { + textstring += " "; + }; + if (numKATSyncParameters == "16") + { + textstring += " "; + }; + break; + + case 2: + textstring += " "; + if (numKATSyncParameters == "8" || numKATSyncParameters == "16") + { + textstring += " "; + } + if (numKATSyncParameters == "16") + { + textstring += " "; + }; + break; + case 3: + textstring += " "; + if (numKATSyncParameters == "8" || numKATSyncParameters == "16") + { + textstring += " "; + } + if (numKATSyncParameters == "16") + { + textstring += " "; + } + break; + case 4: + textstring += ""; + if (numKATSyncParameters == "8" || numKATSyncParameters == "16") + { + textstring += " "; + } + if (numKATSyncParameters == "16") + { + textstring += " "; + } + break; + case 5: + textstring += " "; + if (numKATSyncParameters == "16") + { + textstring += " "; + }; break; + case 6: + textstring += " "; + if (numKATSyncParameters == "16") + { + textstring += " "; + }; break; + case 7: + textstring += " "; + if (numKATSyncParameters == "16") + { + textstring += " "; + }; break; + case 8: textstring += " "; break; //16 mode + case 9: textstring += " "; break; //16 mode + case 10: textstring += " "; break; //16 mode + case 11: textstring += " "; break; //16 mode + case 12: textstring += " "; break; //16 mode + case 13: textstring += " "; break; //16 mode + case 14: textstring += " "; break; //16 mode + case 15: textstring += " "; break; //16 mode + default:; break; + } + return textstring; + } + + public static float GetLetterID(char c) + { + float letter = 0.0f; + switch (c) + { + case ' ': letter = 0; break; + case '!': letter = 1; break; + case '\"': letter = 2; break; + case '#': letter = 3; break; + case '$': letter = 4; break; + case '%': letter = 5; break; + case '&': letter = 6; break; + case '\'': letter = 7; break; + case '(': letter = 8; break; + case ')': letter = 9; break; + + case '*': letter = 10; break; + case '+': letter = 11; break; + case ',': letter = 12; break; + case '-': letter = 13; break; + case '.': letter = 14; break; + case '/': letter = 15; break; + case '0': letter = 16; break; + case '1': letter = 17; break; + case '2': letter = 18; break; + case '3': letter = 19; break; + + case '4': letter = 20; break; + case '5': letter = 21; break; + case '6': letter = 22; break; + case '7': letter = 23; break; + case '8': letter = 24; break; + case '9': letter = 25; break; + case ':': letter = 26; break; + case ';': letter = 27; break; + case '<': letter = 28; break; + case '=': letter = 29; break; + + case '>': letter = 30; break; + case '?': letter = 31; break; + case '@': letter = 32; break; + case 'A': letter = 33; break; + case 'B': letter = 34; break; + case 'C': letter = 35; break; + case 'D': letter = 36; break; + case 'E': letter = 37; break; + case 'F': letter = 38; break; + case 'G': letter = 39; break; + + case 'H': letter = 40; break; + case 'I': letter = 41; break; + case 'J': letter = 42; break; + case 'K': letter = 43; break; + case 'L': letter = 44; break; + case 'M': letter = 45; break; + case 'N': letter = 46; break; + case 'O': letter = 47; break; + case 'P': letter = 48; break; + case 'Q': letter = 49; break; + + case 'R': letter = 50; break; + case 'S': letter = 51; break; + case 'T': letter = 52; break; + case 'U': letter = 53; break; + case 'V': letter = 54; break; + case 'W': letter = 55; break; + case 'X': letter = 56; break; + case 'Y': letter = 57; break; + case 'Z': letter = 58; break; + case '[': letter = 59; break; + + case '\\': letter = 60; break; + case ']': letter = 61; break; + case '^': letter = 62; break; + case '_': letter = 63; break; + case '`': letter = 64; break; + case 'a': letter = 65; break; + case 'b': letter = 66; break; + case 'c': letter = 67; break; + case 'd': letter = 68; break; + case 'e': letter = 69; break; + + case 'f': letter = 70; break; + case 'g': letter = 71; break; + case 'h': letter = 72; break; + case 'i': letter = 73; break; + case 'j': letter = 74; break; + case 'k': letter = 75; break; + case 'l': letter = 76; break; + case 'm': letter = 77; break; + case 'n': letter = 78; break; + case 'o': letter = 79; break; + + case 'p': letter = 80; break; + case 'q': letter = 81; break; + case 'r': letter = 82; break; + case 's': letter = 83; break; + case 't': letter = 84; break; + case 'u': letter = 85; break; + case 'v': letter = 86; break; + case 'w': letter = 87; break; + case 'x': letter = 88; break; + case 'y': letter = 89; break; + + case 'z': letter = 90; break; + case '{': letter = 91; break; + case '|': letter = 92; break; + case '}': letter = 93; break; + case '~': letter = 94; break; + case '€': letter = 95; break; + + /// case '非': letter = 96; break;//trying to map + // case '常': letter = 97; break;//trying to map + // case '': letter = 98; break; + //case '': letter = 99; break; + + //case '': letter = 100; break; + //case '': letter = 101; break; + //case '': letter = 102; break; + //case '': letter = 103; break; + //case '': letter = 104; break; + //case '': letter = 105; break; + //case '': letter = 106; break; + //case '': letter = 107; break; + //case '': letter = 108; break; + // case '': letter = 109; break; + + // case '': letter = 110; break; + // case '': letter = 111; break; + //case '': letter = 112; break; + // case '': letter = 113; break; + // case '': letter = 114; break; + // case '': letter = 115; break; + // case '': letter = 116; break; + //case '': letter = 117; break; + //case '': letter = 118; break; + // case '': letter = 119; break; + + // case '': letter = 120; break; + // case '': letter = 121; break; + //case '': letter = 122; break; + //case '': letter = 123; break; + // case '': letter = 124; break; + // case '': letter = 125; break; + // case '': letter = 126; break; + case 'ぬ': letter = 127; break; //used as heart emoji + //case '': letter = 128; break; + case 'ふ': letter = 129; break; //used as spotify emoji + + case 'あ': letter = 130; break;//emoji 1 + case 'う': letter = 131; break;//emoji 1 + case 'え': letter = 132; break;//emoji 2 + case 'お': letter = 133; break;//emoji 2 + case 'や': letter = 134; break;//emoji 3 + case 'ゆ': letter = 135; break;//emoji 3 + case 'よ': letter = 136; break;//emoji 4 + case 'わ': letter = 137; break;//emoji 4 + case 'を': letter = 138; break;//emoji 5 + case 'ほ': letter = 139; break;//emoji 5 + + case 'へ': letter = 140; break;//emoji 6 + case 'た': letter = 141; break;//emoji 6 + case 'て': letter = 142; break;//emoji 7 + case 'い': letter = 143; break;//emoji 7 + case 'す': letter = 144; break;//emoji 8 + case 'か': letter = 145; break;//emoji 8 + case 'ん': letter = 146; break;//emoji 9 + case 'な': letter = 147; break;//emoji 9 + case 'に': letter = 148; break;//emoji 10 + case 'ら': letter = 149; break;//emoji 10 + + case 'せ': letter = 150; break;//11 + case 'ち': letter = 151; break;//11 + case 'と': letter = 152; break;//12 + case 'し': letter = 153; break;//12 + case 'は': letter = 154; break;//13 + case 'き': letter = 155; break;//13 + case 'く': letter = 156; break;//14 + case 'ま': letter = 157; break;//14 + case 'の': letter = 158; break;//15 + case 'り': letter = 159; break;//15 + + case 'れ': letter = 160; break;//16 + case 'け': letter = 161; break;//16 + case 'む': letter = 162; break;//17 + case 'つ': letter = 163; break;//17 + case 'さ': letter = 164; break;//18 + case 'そ': letter = 165; break;//18 + case 'ひ': letter = 166; break;//19 + case 'こ': letter = 167; break;//19 + case 'み': letter = 168; break;//20 + case 'も': letter = 169; break;//20 + + case 'ね': letter = 170; break; + case 'る': letter = 171; break; + case 'め': letter = 172; break; + case 'ろ': letter = 173; break; + case '。': letter = 174; break; + case 'ぶ': letter = 175; break; + case 'ぷ': letter = 176; break; + case 'ぼ': letter = 177; break; + case 'ぽ': letter = 178; break; + case 'べ': letter = 179; break;//25 + + case 'ぺ': letter = 180; break; + case 'だ': letter = 181; break; + case 'で': letter = 182; break; + case 'ず': letter = 183; break; + case 'が': letter = 184; break; + case 'ぜ': letter = 185; break; + case 'ぢ': letter = 186; break; + case 'ど': letter = 187; break; + case 'じ': letter = 188; break; + case 'ば': letter = 189; break;//30 + + case 'ぱ': letter = 190; break; + case 'ぎ': letter = 191; break; + case 'ぐ': letter = 192; break; + case 'げ': letter = 193; break; + case 'づ': letter = 194; break; + case 'ざ': letter = 195; break; + case 'ぞ': letter = 196; break; + case 'び': letter = 197; break; + case 'ぴ': letter = 198; break; + case 'ご': letter = 199; break;//35 + + case 'ぁ': letter = 200; break; + case 'ぃ': letter = 201; break; + case 'ぅ': letter = 202; break; + case 'ぇ': letter = 203; break; + case 'ぉ': letter = 204; break; + case 'ゃ': letter = 205; break; + case 'ゅ': letter = 206; break; + case 'ょ': letter = 207; break; + case 'ヌ': letter = 208; break; + case 'フ': letter = 209; break;//40 + + case 'ア': letter = 210; break; + case 'ウ': letter = 211; break; + case 'エ': letter = 212; break; + case 'オ': letter = 213; break; + case 'ヤ': letter = 214; break; + case 'ユ': letter = 215; break; + case 'ヨ': letter = 216; break; + case 'ワ': letter = 217; break; + case 'ヲ': letter = 218; break; + case 'ホ': letter = 219; break;//45 + + case 'ヘ': letter = 220; break; + case 'タ': letter = 221; break; + case 'テ': letter = 222; break; + case 'イ': letter = 223; break; + case 'ス': letter = 224; break; + case 'カ': letter = 225; break; + case 'ン': letter = 226; break; + case 'ナ': letter = 227; break; + case 'ニ': letter = 228; break; + case 'ラ': letter = 229; break;//50 + + case 'セ': letter = 230; break; + case 'チ': letter = 231; break; + case 'ト': letter = 232; break; + case 'シ': letter = 233; break; + case 'ハ': letter = 234; break; + case 'キ': letter = 235; break; + case 'ク': letter = 236; break; + case 'マ': letter = 237; break; + case 'ノ': letter = 238; break; + case 'リ': letter = 239; break;//55 + + case 'レ': letter = 240; break; + case 'ケ': letter = 241; break; + case 'ム': letter = 242; break; + case 'ツ': letter = 243; break; + case 'サ': letter = 244; break; + case 'ソ': letter = 245; break; + case 'ヒ': letter = 246; break; + case 'コ': letter = 247; break; + case 'ミ': letter = 248; break; + case 'モ': letter = 249; break;//60 + + case 'ネ': letter = 250; break; + case 'ル': letter = 251; break; + case 'メ': letter = 252; break; + case 'ロ': letter = 253; break; + case '〝': letter = 254; break; + case '°': letter = 255; break;//63 + + + case '¿': letter = 31; break; + + case 'À': letter = 33; break; + case 'Á': letter = 33; break; + case 'Â': letter = 33; break; + case 'Ã': letter = 33; break; + case 'Ä': letter = 33; break; + case 'Å': letter = 33; break; + case 'Æ': letter = 33; break; + + case 'à': letter = 65; break; + case 'á': letter = 65; break; + case 'â': letter = 65; break; + case 'ã': letter = 65; break; + case 'ä': letter = 65; break; + case 'å': letter = 65; break; + case 'æ': letter = 65; break; + + case 'È': letter = 37; break; + case 'É': letter = 37; break; + case 'Ê': letter = 37; break; + case 'Ë': letter = 37; break; + + case 'è': letter = 69; break; + case 'é': letter = 69; break; + case 'ê': letter = 69; break; + case 'ë': letter = 69; break; + + + case 'Ì': letter = 41; break; + case 'Í': letter = 41; break; + case 'Î': letter = 41; break; + case 'Ï': letter = 41; break; + + case 'ì': letter = 73; break; + case 'í': letter = 73; break; + case 'î': letter = 73; break; + case 'ï': letter = 73; break; + + case 'Ñ': letter = 46; break; + case 'ñ': letter = 78; break; + + + case 'Ò': letter = 47; break; + case 'Ó': letter = 47; break; + case 'Ô': letter = 47; break; + case 'Õ': letter = 47; break; + case 'Ö': letter = 47; break; + + case 'ò': letter = 79; break; + case 'ó': letter = 79; break; + case 'ô': letter = 79; break; + case 'õ': letter = 79; break; + case 'ö': letter = 79; break; + + + default: letter = 31; break; + + + + + + + } + + + if (letter > 127.5) + { + letter = letter - 256; + + } + letter = letter / 127; + + return letter; + } + + diff --git a/OSCVRCWiz/VoiceWizardWindow.cs b/OSCVRCWiz/VoiceWizardWindow.cs index cfa61735..b156b5df 100644 --- a/OSCVRCWiz/VoiceWizardWindow.cs +++ b/OSCVRCWiz/VoiceWizardWindow.cs @@ -1862,7 +1862,7 @@ private void hideVRCTextButton_Click(object sender, EventArgs e)//hide private void button2_Click_1(object sender, EventArgs e)//replay { - OutputText.outputVRChat(OutputText.lastKatString, "tttAdd"); + OutputText.outputVRChat(OutputText.lastKatString, OutputText.DisplayTextType.UpdateText); } #endregion @@ -2024,11 +2024,11 @@ private void button44_Click(object sender, EventArgs e) if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonOSC.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyKatDisable.Checked == false) { - Task.Run(() => OutputText.outputVRChat(currentTime, "time")); + Task.Run(() => OutputText.outputVRChat(currentTime, OutputText.DisplayTextType.Time)); } if (VoiceWizardWindow.MainFormGlobal.rjToggleButtonChatBox.Checked == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonSpotifyChatboxDisable.Checked == false) { - Task.Run(() => OutputText.outputVRChatSpeechBubbles(currentTime, "time")); //original + Task.Run(() => OutputText.outputVRChatSpeechBubbles(currentTime, OutputText.DisplayTextType.Time)); //original } } From 29633329444eceb46fb27d2f36821e47b258a2b2 Mon Sep 17 00:00:00 2001 From: VRCWizard <101527472+VRCWizard@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:59:29 -0500 Subject: [PATCH 2/2] v1.5.9 --- OSCVRCWiz/App.config | Bin 78372 -> 78890 bytes OSCVRCWiz/Resources/Audio/AudioDevices.cs | 10 ++ OSCVRCWiz/Resources/StartUp/Updater.cs | 2 +- .../Heartrate/HeartratePulsoid.cs | 4 +- .../Integrations/Media/SpotifyAddon.cs | 3 + .../Speech Recognition/AzureRecognition.cs | 153 +++++++++--------- OSCVRCWiz/Services/Text/OutputText.cs | 30 +++- OSCVRCWiz/Settings/LoadSettings.cs | 15 +- OSCVRCWiz/Settings/SaveSettings.cs | 6 + OSCVRCWiz/Settings/Settings1.Designer.cs | 24 +++ OSCVRCWiz/Settings/Settings1.settings | 6 + OSCVRCWiz/VoiceWizardWindow.Designer.cs | 140 ++++++++++++---- OSCVRCWiz/VoiceWizardWindow.cs | 29 ++-- 13 files changed, 288 insertions(+), 134 deletions(-) diff --git a/OSCVRCWiz/App.config b/OSCVRCWiz/App.config index bdd1eec3b8311ac47ef83754c23782880c6941c4..3b65138bd0feaef69d347842b09564ce81a7b576 100644 GIT binary patch delta 99 zcmZ4Tgk{wWmJJWCP2M1^HaYJOm#`BE@8+7(m4!4K#^jgOb$cIbU_WqQt{+5GB;Lo@(katY-C diff --git a/OSCVRCWiz/Resources/Audio/AudioDevices.cs b/OSCVRCWiz/Resources/Audio/AudioDevices.cs index bca1888e..493c086b 100644 --- a/OSCVRCWiz/Resources/Audio/AudioDevices.cs +++ b/OSCVRCWiz/Resources/Audio/AudioDevices.cs @@ -283,6 +283,16 @@ public static void PlayAudioStream(Stream audioStream, TTSMessageQueue.TTSMessag { try { + //delay before audio + int delayBeforeAudio = Int32.Parse(VoiceWizardWindow.MainFormGlobal.textBoxDelayBeforeAudio.Text.ToString()); + Thread.Sleep(delayBeforeAudio); + + if(delayBeforeAudio != 0) + { + OutputText.outputLog("[Playing Delayed Audio]"); + } + + MemoryStream memoryStream = new MemoryStream(); audioStream.Flush(); audioStream.Seek(0, SeekOrigin.Begin); diff --git a/OSCVRCWiz/Resources/StartUp/Updater.cs b/OSCVRCWiz/Resources/StartUp/Updater.cs index 2e33e501..efb0eb74 100644 --- a/OSCVRCWiz/Resources/StartUp/Updater.cs +++ b/OSCVRCWiz/Resources/StartUp/Updater.cs @@ -7,7 +7,7 @@ namespace OSCVRCWiz.Resources.StartUp public class Updater { - public static string currentVersion = "1.5.8.5"; + public static string currentVersion = "1.5.9"; public static string updateXMLName = "https://github.com/VRCWizard/TTS-Voice-Wizard/releases/latest/download/AutoUpdater-x64.xml"; public static async void getGithubInfo() diff --git a/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs b/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs index 15690a82..2ecb7600 100644 --- a/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs +++ b/OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs @@ -217,8 +217,8 @@ private static async void doHeartrateTimerTick() var message3 = new CoreOSC.OscMessage("/avatar/parameters/hundredsHR", hundreds); OSC.OSCSender.Send(message3); - float HRPercent = currentHR / 256; - var message4 = new CoreOSC.OscMessage("/avatar/parameters/HRPercent", HRPercent); + float HRPercent = (float)currentHR / 256; + var message4 = new CoreOSC.OscMessage("/avatar/parameters/HRPercent", (float)HRPercent); OSC.OSCSender.Send(message4); diff --git a/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs b/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs index 4d5ca4c7..c62cd184 100644 --- a/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs +++ b/OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs @@ -202,6 +202,7 @@ public static async Task spotifyGetCurrentSongInfo(bool playOnce) theString = theString.Replace("{pause}", spotifyPausedIndicator); theString = theString.Replace("{spotifyVolume}", deviceVolume); theString = theString.Replace("{album}", album); + theString = theString.Replace("{nline}", "\u2028"); theString = theString.Replace("{counter1}", VRChatListener.counter1.ToString()); theString = theString.Replace("{counter2}", VRChatListener.counter2.ToString()); theString = theString.Replace("{counter3}", VRChatListener.counter3.ToString()); @@ -350,6 +351,7 @@ public static async Task windowsMediaGetSongInfo() theString = theString.Replace("{progressHours}", WindowsMedia.getMediaProgressHours()); theString = theString.Replace("{durationHours}", WindowsMedia.getMediaDurationHours()); theString = theString.Replace("{spotifySymbol}", spotifySymbol); + theString = theString.Replace("{nline}", "\u2028"); theString = theString.Replace("{counter1}", VRChatListener.counter1.ToString()); theString = theString.Replace("{counter2}", VRChatListener.counter2.ToString()); theString = theString.Replace("{counter3}", VRChatListener.counter3.ToString()); @@ -421,6 +423,7 @@ public static async Task soundpadGetSongInfo() theString = theString.Replace("{progressHours}", WindowsMedia.getMediaProgressHours()); theString = theString.Replace("{durationHours}", WindowsMedia.getMediaDurationHours()); theString = theString.Replace("{spotifySymbol}", spotifySymbol); + theString = theString.Replace("{nline}", "\u2028"); theString = theString.Replace("{counter1}", VRChatListener.counter1.ToString()); theString = theString.Replace("{counter2}", VRChatListener.counter2.ToString()); theString = theString.Replace("{counter3}", VRChatListener.counter3.ToString()); diff --git a/OSCVRCWiz/Services/Speech/Speech Recognition/AzureRecognition.cs b/OSCVRCWiz/Services/Speech/Speech Recognition/AzureRecognition.cs index 71b622ff..ca29dfc5 100644 --- a/OSCVRCWiz/Services/Speech/Speech Recognition/AzureRecognition.cs +++ b/OSCVRCWiz/Services/Speech/Speech Recognition/AzureRecognition.cs @@ -10,6 +10,8 @@ using OSCVRCWiz.Resources.StartUp.StartUp; using OSCVRCWiz.Services.Speech; using OSCVRCWiz.Services.Speech.TranslationAPIs; +using System; +using System.Diagnostics; namespace OSCVRCWiz { @@ -28,85 +30,13 @@ public class AzureRecognition public static string YourSubscriptionKey; public static string YourServiceRegion; - - /* public static void fromLanguageID(string fullname) - { - fromLanguage = "en-US"; - switch (fullname) - { - case "Arabic [ar-EG]": fromLanguage = "ar-EG"; break; - case "Chinese [zh-CN]": fromLanguage = "zh-CN"; break; - case "Czech [cs-CZ]": fromLanguage = "cs-CZ"; break; - case "Danish [da-DK]": fromLanguage = "da-DK"; break; - case "Dutch [nl-NL]": fromLanguage = "nl-NL"; break; - case "English [en-US] (Default)": fromLanguage = "en-US"; break; - case "Estonian [et-EE]": fromLanguage = "et-EE"; break; - case "Filipino [fil-PH]": fromLanguage = "fil-PH"; break; - case "Finnish [fi-FI]": fromLanguage = "fi-FI"; break; - case "French [fr-FR]": fromLanguage = "fr-FR"; break; - case "German [de-DE]": fromLanguage = "de-DE"; break; - case "Hindi [hi-IN]": fromLanguage = "hi-IN"; break; - case "Hungarian [hu-HU]": fromLanguage = "hu-HU"; break; - case "Indonesian [id-ID]": fromLanguage = "id-ID"; break; - case "Irish [ga-IE]": fromLanguage = "ga-IE"; break; - case "Italian [it-IT]": fromLanguage = "it-IT"; break; - case "Japanese [ja-JP]": fromLanguage = "ja-JP"; break; - case "Korean [ko-KR]": fromLanguage = "ko-KR"; break; - case "Norwegian [nb-NO]": fromLanguage = "nb-NO"; break; - - case "Persian [fa-IR]": fromLanguage = "fa-IR"; break;//new - case "Polish [pl-PL]": fromLanguage = "pl-PL"; break; - case "Portuguese [pt-BR]": fromLanguage = "pt-BR"; break; - //place holder^^ - case "Russian [ru-RU]": fromLanguage = "ru-RU"; break; - case "Spanish [es-MX]": fromLanguage = "es-MX"; break; - //place holder^^ - case "Swedish [sv-SE]": fromLanguage = "sv-SE"; break; - case "Thai [th-TH]": fromLanguage = "th-TH"; break; - case "Ukrainian [uk-UA]": fromLanguage = "uk-UA"; break; - case "Vietnamese [vi-VN]": fromLanguage = "vi-VN"; break; - default: fromLanguage = "en-US"; break; // if translation to english happens something is wrong - } - } + public static System.Threading.Timer AzureTypingTimer; + public static string AzureTypingInterval = "2000"; + private static string AzureTyping = ""; + - public static void toLanguageID(string fullname) - { - toLanguage = "en"; - - switch (fullname) - { - case "Arabic [ar]": toLanguage = "ar"; break; - case "Chinese [zh]": toLanguage = "zh-Hans"; break; - case "Czech [cs]": toLanguage = "cs"; break; - case "Danish [da]": toLanguage = "da"; break; - case "Dutch [nl]": toLanguage = "nl"; break; - case "English [en]": toLanguage = "en"; break; - case "Estonian [et]": toLanguage = "et"; break; - case "Filipino [fil]": toLanguage = "fil"; break; - case "Finnish [fi]": toLanguage = "fi"; break; - case "French [fr]": toLanguage = "fr"; break; - case "German [de]": toLanguage = "de"; break; - case "Hindi [hi]": toLanguage = "hi"; break; - case "Hungarian [hu]": toLanguage = "hu"; break; - case "Indonesian [id]": toLanguage = "id"; break; - case "Irish [ga]": toLanguage = "ga"; break; - case "Italian [it]": toLanguage = "it"; break; - case "Japanese [ja]": toLanguage = "ja"; break; - case "Korean [ko]": toLanguage = "ko"; break; - case "Norwegian [nb]": toLanguage = "nb"; break; - case "Polish [pl]": toLanguage = "pl"; break; - case "Portuguese [pt]": toLanguage = "pt"; break; - case "Russian [ru]": toLanguage = "ru"; break; - case "Spanish [es]": toLanguage = "es"; break; - case "Swedish [sv]": toLanguage = "sv"; break; - case "Thai [th]": toLanguage = "th"; break; - case "Ukrainian [uk]": toLanguage = "uk"; break; - case "Vietnamese [vi]": toLanguage = "vi"; break; - default: toLanguage = "en"; break; // if translation to english happens something is wrong - } - }*/ public static void speechSetup(string toLanguageFullname, string fromLanguageFullname)//speech to text setup @@ -177,8 +107,8 @@ public static void speechSetup(string toLanguageFullname, string fromLanguageFul string translatedString = speechRecognitionResult.Translations[toLanguage]; //Dictation string tranlated - + // StopAzureTypingTimer(); TTSMessageQueue.QueueMessage(text, "Azure Translate", translatedString); @@ -186,6 +116,17 @@ public static void speechSetup(string toLanguageFullname, string fromLanguageFul } }; + translationRecognizer1.Recognizing += (sender, eventArgs) => + { + AzureTyping = eventArgs.Result.Text; + // OutputText.outputLog(eventArgs.Result.Text); + }; + + speechRecognizer1.Recognizing += (sender, eventArgs) => + { + AzureTyping = eventArgs.Result.Text; + // OutputText.outputLog(eventArgs.Result.Text); + }; speechRecognizer1.Canceled += (sender, eventArgs) => { // Console.WriteLine(eventArgs.Result.Text); @@ -208,11 +149,12 @@ public static void speechSetup(string toLanguageFullname, string fromLanguageFul // Task.Run(() => VoiceWizardWindow.MainFormGlobal.MainDoTTS(text,"Azure")); - + // StopAzureTypingTimer(); TTSMessageQueue.QueueMessage(text, "Azure"); + } }; ///Phrase List @@ -249,6 +191,7 @@ public static void speechSetup(string toLanguageFullname, string fromLanguageFul public static async void speechTTTS(string fromLanguageFullname)//speech to text { + StartAzureTypingTimer(); System.Diagnostics.Debug.WriteLine("Speak into your microphone."); try @@ -273,6 +216,8 @@ public static async void speechTTTS(string fromLanguageFullname)//speech to text var speechRecognitionResult = await speechRecognizer1.RecognizeOnceAsync(); var text = speechRecognitionResult.Text; //Dictation string + StopAzureTypingTimer(); + AzureTyping = ""; TTSMessageQueue.QueueMessage(text, "Azure"); DoSpeech.speechToTextButtonOff(); @@ -365,7 +310,8 @@ public static async void translationSTTTS(string toLanguageFullname, string from // Task.Run(() => VoiceWizardWindow.MainFormGlobal.MainDoTTS(text, "Azure Translate",translatedString)); - + StopAzureTypingTimer(); + AzureTyping = ""; TTSMessageQueue.QueueMessage(text, "Azure Translate", translatedString); DoSpeech.speechToTextButtonOff(); @@ -423,7 +369,8 @@ public static async void stopContinuousListeningNow()//speech to text { if (continuousListening == true) { - + StopAzureTypingTimer(); + AzureTyping = ""; continuousListening = false; // Make the following call at some point to stop recognition: System.Diagnostics.Debug.WriteLine("continuousListening Disabled------------------------------"); @@ -441,5 +388,49 @@ public static async void stopContinuousListeningNow()//speech to text } - } + public static void StartAzureTypingTimer() + { + AzureTypingTimer = new System.Threading.Timer(heartratetimertick); + AzureTypingTimer.Change(Int32.Parse(AzureTypingInterval), Int32.Parse(AzureTypingInterval)-1000); + + + + } + public static void StopAzureTypingTimer() + { + + if (AzureTypingTimer != null) + { + AzureTypingTimer.Change(Timeout.Infinite, Timeout.Infinite); + } + } + + public static void heartratetimertick(object sender) + { + Thread t = new Thread(doAzureTypingTimerTick); + t.Start(); + } + + private static async void doAzureTypingTimerTick() + { + if (VoiceWizardWindow.MainFormGlobal.rjTogglePartialResults.Checked) + { + if (AzureTyping != "") + { + + + + var messageSpeechBubble = new OscMessage("/chatbox/input", AzureTyping, true, false); + OSC.OSCSender.Send(messageSpeechBubble); + OutputText.outputLog($"[Partial Results]: {AzureTyping}"); + + AzureTypingTimer.Change(Int32.Parse(AzureTypingInterval), 0); + } + } + + + } + + + } } \ No newline at end of file diff --git a/OSCVRCWiz/Services/Text/OutputText.cs b/OSCVRCWiz/Services/Text/OutputText.cs index cfa83fbc..d6063e69 100644 --- a/OSCVRCWiz/Services/Text/OutputText.cs +++ b/OSCVRCWiz/Services/Text/OutputText.cs @@ -11,6 +11,7 @@ using OSCVRCWiz.Resources.StartUp.StartUp; using Amazon.Polly.Model; using System.Threading; +using System.Diagnostics; namespace OSCVRCWiz.Services.Text { @@ -145,7 +146,7 @@ public static async void outputVRChatSpeechBubbles(string textstring, DisplayTex // textstring = Encoding.UTF8.GetString(bytes); - System.Diagnostics.Debug.WriteLine("Encoded UTF-8: " + textstring); + // System.Diagnostics.Debug.WriteLine("Encoded UTF-8: " + textstring); var typingbubbleOff = new OscMessage("/chatbox/typing", false);//this is turned on as soon as you press the STTTS button and turned off here @@ -269,10 +270,10 @@ public static async void outputVRChat(string textstringbefore, DisplayTextType t - if (type == DisplayTextType.TextToSpeech || type == DisplayTextType.UpdateText)//remember last message - { + // if (type == DisplayTextType.TextToSpeech || type == DisplayTextType.UpdateText || type == DisplayTextType.WindowsMedia || type == DisplayTextType.Spotify)//remember last message + // { lastKatString = textstringbefore; - } + // } @@ -344,6 +345,7 @@ public static async void outputVRChat(string textstringbefore, DisplayTextType t { if ((DateTime.Now - lastDateTime).Seconds <= 1)//collision prevention { + OutputText.outputLog("[KAT collision prevented]"); Task.Delay(debugDelayValue * lastStringPoint).Wait(); } OSC.OSCSender.Send(OSCClearKatEraseAll); @@ -378,11 +380,15 @@ public static async void outputVRChat(string textstringbefore, DisplayTextType t case DisplayTextType.TextToSpeech://dont clear all if ((DateTime.Now - lastDateTime).Seconds <= 1)//collision prevention { - Task.Delay(debugDelayValue * lastStringPoint).Wait(); + OutputText.outputLog("[KAT collision prevented]"); + Task.Delay(debugDelayValue * (lastStringPoint+1)).Wait(); + } OSC.OSCSender.Send(OSCClearKatEraseAll); + break; + case DisplayTextType.TextToText://dont clear all break; case DisplayTextType.UpdateText://dont clear all break; @@ -660,8 +666,20 @@ public static async void outputVRChat(string textstringbefore, DisplayTextType t } if (EraserRunning == true && VoiceWizardWindow.MainFormGlobal.rjToggleButtonAutoRefreshKAT.Checked == true) { + if((type == DisplayTextType.WindowsMedia || type == DisplayTextType.Spotify) && VoiceWizardWindow.MainFormGlobal.rjToggleButtonPeriodic.Checked) + { + return; + } + if(type == DisplayTextType.Counters || type== DisplayTextType.HeartRate || type == DisplayTextType.TextToText) + { + return; + } + + Task.Delay(2000).Wait(); outputVRChat(lastKatString, DisplayTextType.RepeatText); + System.Diagnostics.Debug.WriteLine("--Repeating Kat Text"); + } } @@ -790,7 +808,7 @@ private static void doTypeTimerTick()//Send Typing Parameter to VRChat { OSCListener.pauseBPM = true; SpotifyAddon.pauseSpotify = true; - Task.Run(() => OutputText.outputVRChat(theString, DisplayTextType.UpdateText)); //original + Task.Run(() => OutputText.outputVRChat(theString, DisplayTextType.TextToText)); //original } } typingBox = false; diff --git a/OSCVRCWiz/Settings/LoadSettings.cs b/OSCVRCWiz/Settings/LoadSettings.cs index 5836f953..9c1b46ee 100644 --- a/OSCVRCWiz/Settings/LoadSettings.cs +++ b/OSCVRCWiz/Settings/LoadSettings.cs @@ -345,11 +345,19 @@ public static void LoadingSettings() VoiceWizardWindow.MainFormGlobal.counterOutputInterval.Text = Settings1.Default.CounterOutputInterval; - VoiceWizardWindow.MainFormGlobal.Invoke((MethodInvoker)delegate () + // VoiceWizardWindow.MainFormGlobal.Invoke((MethodInvoker)delegate () + // { + try { VoiceWizardWindow.MainFormGlobal.comboBoxPara.SelectedIndex = Settings1.Default.SyncParaValue; + } + catch + { + VoiceWizardWindow.MainFormGlobal.comboBoxPara.SelectedIndex = 0; + } + + // }); - }); VoiceWizardWindow.MainFormGlobal.comboBoxSTT.SelectedItem = Settings1.Default.STTModeSave; VoiceWizardWindow.MainFormGlobal.comboBoxTTSMode.SelectedItem = Settings1.Default.ttsMode; @@ -379,7 +387,10 @@ public static void LoadingSettings() VoiceWizardWindow.MainFormGlobal.rjToggleShowConnectURISpotify.Checked = Settings1.Default.showSpotifyURi; + VoiceWizardWindow.MainFormGlobal.textBoxDelayBeforeAudio.Text = Settings1.Default.delayBeforeOuput; + + VoiceWizardWindow.MainFormGlobal.rjTogglePartialResults.Checked = Settings1.Default.azurePartialResults; // VoiceWizardWindow.MainFormGlobal.comboBoxPreset.SelectedItem = Settings1.Default.saveVoicePreset; try diff --git a/OSCVRCWiz/Settings/SaveSettings.cs b/OSCVRCWiz/Settings/SaveSettings.cs index ecae2033..e1c81806 100644 --- a/OSCVRCWiz/Settings/SaveSettings.cs +++ b/OSCVRCWiz/Settings/SaveSettings.cs @@ -305,6 +305,12 @@ public static void SavingSettings() Settings1.Default.showSpotifyURi = VoiceWizardWindow.MainFormGlobal.rjToggleShowConnectURISpotify.Checked; + Settings1.Default.SyncParaValue = VoiceWizardWindow.MainFormGlobal.comboBoxPara.SelectedIndex; + + Settings1.Default.delayBeforeOuput = VoiceWizardWindow.MainFormGlobal.textBoxDelayBeforeAudio.Text; + + Settings1.Default.azurePartialResults = VoiceWizardWindow.MainFormGlobal.rjTogglePartialResults.Checked; + Settings1.Default.Save(); //emojiSettings.Default.Save(); VoiceWizardWindow.MainFormGlobal.webView21.Dispose(); diff --git a/OSCVRCWiz/Settings/Settings1.Designer.cs b/OSCVRCWiz/Settings/Settings1.Designer.cs index 2f2a5845..2a80c466 100644 --- a/OSCVRCWiz/Settings/Settings1.Designer.cs +++ b/OSCVRCWiz/Settings/Settings1.Designer.cs @@ -2494,5 +2494,29 @@ public bool labsSpeakerBoost { this["labsSpeakerBoost"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public string delayBeforeOuput { + get { + return ((string)(this["delayBeforeOuput"])); + } + set { + this["delayBeforeOuput"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool azurePartialResults { + get { + return ((bool)(this["azurePartialResults"])); + } + set { + this["azurePartialResults"] = value; + } + } } } diff --git a/OSCVRCWiz/Settings/Settings1.settings b/OSCVRCWiz/Settings/Settings1.settings index 480cadab..ed13b9c3 100644 --- a/OSCVRCWiz/Settings/Settings1.settings +++ b/OSCVRCWiz/Settings/Settings1.settings @@ -620,5 +620,11 @@ True + + 0 + + + False + \ No newline at end of file diff --git a/OSCVRCWiz/VoiceWizardWindow.Designer.cs b/OSCVRCWiz/VoiceWizardWindow.Designer.cs index db8a19c1..0d0d2246 100644 --- a/OSCVRCWiz/VoiceWizardWindow.Designer.cs +++ b/OSCVRCWiz/VoiceWizardWindow.Designer.cs @@ -133,6 +133,7 @@ private void InitializeComponent() tabSpotify = new TabPage(); this.iconButton1 = new global::FontAwesome.Sharp.IconButton(); groupBox5 = new GroupBox(); + button21 = new Button(); button22 = new Button(); this.buttonExportMedia = new global::FontAwesome.Sharp.IconButton(); this.buttonImportMedia = new global::FontAwesome.Sharp.IconButton(); @@ -319,6 +320,8 @@ private void InitializeComponent() label105 = new Label(); this.rjToggleButtonSounds = new global::OSCVRCWiz.RJControls.RJToggleButton(); groupBox1 = new GroupBox(); + label201 = new Label(); + textBoxDelayBeforeAudio = new TextBox(); this.iconButton2 = new global::FontAwesome.Sharp.IconButton(); button14 = new Button(); this.rjToggleButtonAutoSend = new global::OSCVRCWiz.RJControls.RJToggleButton(); @@ -682,6 +685,8 @@ private void InitializeComponent() openFileDialog1 = new OpenFileDialog(); logPanel = new Panel(); button45 = new Button(); + this.rjTogglePartialResults = new global::OSCVRCWiz.RJControls.RJToggleButton(); + label203 = new Label(); mainTabControl.SuspendLayout(); tabPage4.SuspendLayout(); ((global::System.ComponentModel.ISupportInitialize)(this.webView21)).BeginInit(); @@ -2394,7 +2399,7 @@ private void InitializeComponent() this.iconButton1.IconFont = global::FontAwesome.Sharp.IconFont.Auto; this.iconButton1.IconSize = 25; this.iconButton1.ImageAlign = ContentAlignment.MiddleLeft; - this.iconButton1.Location = new Point(511, 3); + this.iconButton1.Location = new Point(460, 3); this.iconButton1.Margin = new Padding(3, 2, 3, 2); this.iconButton1.Name = "iconButton1"; this.iconButton1.RightToLeft = RightToLeft.No; @@ -2407,6 +2412,7 @@ private void InitializeComponent() // // groupBox5 // + groupBox5.Controls.Add(button21); groupBox5.Controls.Add(button22); groupBox5.Controls.Add(this.buttonExportMedia); groupBox5.Controls.Add(this.buttonImportMedia); @@ -2445,6 +2451,21 @@ private void InitializeComponent() groupBox5.TabStop = false; groupBox5.Text = "General Media Settings"; // + // button21 + // + button21.Anchor = (AnchorStyles)((AnchorStyles.Top) | (AnchorStyles.Right)); + button21.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); + button21.FlatStyle = FlatStyle.Flat; + button21.ForeColor = Color.Snow; + button21.Location = new Point(705, 74); + button21.Margin = new Padding(3, 2, 3, 2); + button21.Name = "button21"; + button21.Size = new Size(25, 25); + button21.TabIndex = 160; + button21.Text = "\U0001f90f"; + button21.UseVisualStyleBackColor = false; + button21.Click += this.button21_Click; + // // button22 // button22.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); @@ -2612,7 +2633,7 @@ private void InitializeComponent() volumeStats.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); volumeStats.FlatStyle = FlatStyle.Flat; volumeStats.ForeColor = Color.Snow; - volumeStats.Location = new Point(640, 74); + volumeStats.Location = new Point(610, 74); volumeStats.Margin = new Padding(3, 2, 3, 2); volumeStats.Name = "volumeStats"; volumeStats.Size = new Size(25, 25); @@ -2842,7 +2863,7 @@ private void InitializeComponent() heartRateStats.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); heartRateStats.FlatStyle = FlatStyle.Flat; heartRateStats.ForeColor = Color.Snow; - heartRateStats.Location = new Point(704, 74); + heartRateStats.Location = new Point(674, 74); heartRateStats.Margin = new Padding(3, 2, 3, 2); heartRateStats.Name = "heartRateStats"; heartRateStats.Size = new Size(25, 25); @@ -2857,7 +2878,7 @@ private void InitializeComponent() batteryStats.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); batteryStats.FlatStyle = FlatStyle.Flat; batteryStats.ForeColor = Color.Snow; - batteryStats.Location = new Point(673, 74); + batteryStats.Location = new Point(643, 74); batteryStats.Margin = new Padding(3, 2, 3, 2); batteryStats.Name = "batteryStats"; batteryStats.Size = new Size(25, 25); @@ -2872,7 +2893,7 @@ private void InitializeComponent() durationStats.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); durationStats.FlatStyle = FlatStyle.Flat; durationStats.ForeColor = Color.Snow; - durationStats.Location = new Point(609, 74); + durationStats.Location = new Point(579, 74); durationStats.Margin = new Padding(3, 2, 3, 2); durationStats.Name = "durationStats"; durationStats.Size = new Size(25, 25); @@ -2887,7 +2908,7 @@ private void InitializeComponent() songStats.BackColor = Color.FromArgb((int)((byte)(31)), (int)((byte)(30)), (int)((byte)(68))); songStats.FlatStyle = FlatStyle.Flat; songStats.ForeColor = Color.Snow; - songStats.Location = new Point(577, 74); + songStats.Location = new Point(547, 74); songStats.Margin = new Padding(3, 2, 3, 2); songStats.Name = "songStats"; songStats.Size = new Size(25, 25); @@ -3264,7 +3285,7 @@ private void InitializeComponent() this.iconButton31.IconFont = global::FontAwesome.Sharp.IconFont.Auto; this.iconButton31.IconSize = 35; this.iconButton31.ImageAlign = ContentAlignment.MiddleLeft; - this.iconButton31.Location = new Point(679, 3); + this.iconButton31.Location = new Point(628, 3); this.iconButton31.Margin = new Padding(3, 2, 3, 2); this.iconButton31.Name = "iconButton31"; this.iconButton31.Size = new Size(44, 38); @@ -4210,7 +4231,7 @@ private void InitializeComponent() groupBox17.Controls.Add(this.rjToggleButtonChatBox); groupBox17.Controls.Add(this.rjToggleButtonShowKeyboard); groupBox17.ForeColor = Color.White; - groupBox17.Location = new Point(19, 1040); + groupBox17.Location = new Point(19, 1071); groupBox17.Margin = new Padding(3, 2, 3, 2); groupBox17.Name = "groupBox17"; groupBox17.Padding = new Padding(3, 2, 3, 2); @@ -4343,7 +4364,7 @@ private void InitializeComponent() groupBox18.Controls.Add(label102); groupBox18.Controls.Add(this.rjToggleButtonOBSText); groupBox18.ForeColor = Color.White; - groupBox18.Location = new Point(20, 1354); + groupBox18.Location = new Point(20, 1386); groupBox18.Margin = new Padding(3, 2, 3, 2); groupBox18.Name = "groupBox18"; groupBox18.Padding = new Padding(3, 2, 3, 2); @@ -4512,7 +4533,7 @@ private void InitializeComponent() groupBox19.Controls.Add(button1); groupBox19.Controls.Add(textBoxErase); groupBox19.ForeColor = Color.White; - groupBox19.Location = new Point(19, 863); + groupBox19.Location = new Point(19, 894); groupBox19.Margin = new Padding(3, 2, 3, 2); groupBox19.Name = "groupBox19"; groupBox19.Padding = new Padding(3, 2, 3, 2); @@ -4695,7 +4716,7 @@ private void InitializeComponent() groupBox20.Controls.Add(buttonDelayHere); groupBox20.Controls.Add(textBoxDelay); groupBox20.ForeColor = Color.White; - groupBox20.Location = new Point(19, 1154); + groupBox20.Location = new Point(19, 1186); groupBox20.Margin = new Padding(3, 2, 3, 2); groupBox20.Name = "groupBox20"; groupBox20.Padding = new Padding(3, 2, 3, 2); @@ -4852,7 +4873,7 @@ private void InitializeComponent() groupBox13.Controls.Add(label105); groupBox13.Controls.Add(this.rjToggleButtonSounds); groupBox13.ForeColor = Color.White; - groupBox13.Location = new Point(19, 588); + groupBox13.Location = new Point(19, 619); groupBox13.Margin = new Padding(3, 2, 3, 2); groupBox13.Name = "groupBox13"; groupBox13.Padding = new Padding(3, 2, 3, 2); @@ -5068,6 +5089,8 @@ private void InitializeComponent() // // groupBox1 // + groupBox1.Controls.Add(label201); + groupBox1.Controls.Add(textBoxDelayBeforeAudio); groupBox1.Controls.Add(this.iconButton2); groupBox1.Controls.Add(button14); groupBox1.Controls.Add(this.rjToggleButtonAutoSend); @@ -5132,11 +5155,31 @@ private void InitializeComponent() groupBox1.Margin = new Padding(3, 2, 3, 2); groupBox1.Name = "groupBox1"; groupBox1.Padding = new Padding(3, 2, 3, 2); - groupBox1.Size = new Size(706, 582); + groupBox1.Size = new Size(706, 613); groupBox1.TabIndex = 100; groupBox1.TabStop = false; groupBox1.Text = "General"; // + // label201 + // + label201.AutoSize = true; + label201.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); + label201.ForeColor = Color.Snow; + label201.Location = new Point(9, 549); + label201.Name = "label201"; + label201.Size = new Size(135, 15); + label201.TabIndex = 165; + label201.Text = "Delay Before Audio (ms)"; + // + // textBoxDelayBeforeAudio + // + textBoxDelayBeforeAudio.Location = new Point(10, 566); + textBoxDelayBeforeAudio.Margin = new Padding(3, 2, 3, 2); + textBoxDelayBeforeAudio.Name = "textBoxDelayBeforeAudio"; + textBoxDelayBeforeAudio.Size = new Size(110, 23); + textBoxDelayBeforeAudio.TabIndex = 164; + textBoxDelayBeforeAudio.Text = "0"; + // // iconButton2 // this.iconButton2.Anchor = (AnchorStyles)((AnchorStyles.Top) | (AnchorStyles.Right)); @@ -5165,7 +5208,7 @@ private void InitializeComponent() button14.FlatStyle = FlatStyle.Flat; button14.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); button14.ForeColor = Color.Snow; - button14.Location = new Point(545, 505); + button14.Location = new Point(545, 536); button14.Margin = new Padding(3, 2, 3, 2); button14.Name = "button14"; button14.Size = new Size(155, 28); @@ -5284,7 +5327,7 @@ private void InitializeComponent() button38.FlatStyle = FlatStyle.Flat; button38.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); button38.ForeColor = Color.Snow; - button38.Location = new Point(544, 466); + button38.Location = new Point(544, 497); button38.Margin = new Padding(3, 2, 3, 2); button38.Name = "button38"; button38.Size = new Size(155, 28); @@ -5494,7 +5537,7 @@ private void InitializeComponent() button47.FlatStyle = FlatStyle.Flat; button47.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); button47.ForeColor = Color.Snow; - button47.Location = new Point(544, 546); + button47.Location = new Point(544, 577); button47.Margin = new Padding(3, 2, 3, 2); button47.Name = "button47"; button47.Size = new Size(155, 28); @@ -5962,6 +6005,8 @@ private void InitializeComponent() // // groupBox12 // + groupBox12.Controls.Add(this.rjTogglePartialResults); + groupBox12.Controls.Add(label203); groupBox12.Controls.Add(this.rjToggleTranslateSameLanguage); groupBox12.Controls.Add(label193); groupBox12.Controls.Add(this.buttonExportDict); @@ -5983,7 +6028,7 @@ private void InitializeComponent() groupBox12.Margin = new Padding(3, 2, 3, 2); groupBox12.Name = "groupBox12"; groupBox12.Padding = new Padding(3, 2, 3, 2); - groupBox12.Size = new Size(620, 433); + groupBox12.Size = new Size(620, 462); groupBox12.TabIndex = 109; groupBox12.TabStop = false; groupBox12.Text = "Azure Settings"; @@ -5992,7 +6037,7 @@ private void InitializeComponent() // this.rjToggleTranslateSameLanguage.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); this.rjToggleTranslateSameLanguage.AutoSize = true; - this.rjToggleTranslateSameLanguage.Location = new Point(5, 316); + this.rjToggleTranslateSameLanguage.Location = new Point(8, 302); this.rjToggleTranslateSameLanguage.Margin = new Padding(3, 2, 3, 2); this.rjToggleTranslateSameLanguage.MinimumSize = new Size(39, 16); this.rjToggleTranslateSameLanguage.Name = "rjToggleTranslateSameLanguage"; @@ -6010,7 +6055,7 @@ private void InitializeComponent() label193.AutoSize = true; label193.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); label193.ForeColor = Color.Snow; - label193.Location = new Point(52, 315); + label193.Location = new Point(55, 301); label193.Name = "label193"; label193.Size = new Size(198, 15); label193.TabIndex = 121; @@ -6027,7 +6072,7 @@ private void InitializeComponent() this.buttonExportDict.IconColor = Color.White; this.buttonExportDict.IconFont = global::FontAwesome.Sharp.IconFont.Auto; this.buttonExportDict.IconSize = 15; - this.buttonExportDict.Location = new Point(101, 230); + this.buttonExportDict.Location = new Point(99, 213); this.buttonExportDict.Margin = new Padding(3, 2, 3, 2); this.buttonExportDict.Name = "buttonExportDict"; this.buttonExportDict.Size = new Size(87, 25); @@ -6048,7 +6093,7 @@ private void InitializeComponent() this.buttonImportDict.IconColor = Color.White; this.buttonImportDict.IconFont = global::FontAwesome.Sharp.IconFont.Auto; this.buttonImportDict.IconSize = 15; - this.buttonImportDict.Location = new Point(8, 230); + this.buttonImportDict.Location = new Point(6, 213); this.buttonImportDict.Margin = new Padding(3, 2, 3, 2); this.buttonImportDict.Name = "buttonImportDict"; this.buttonImportDict.Size = new Size(87, 25); @@ -6062,7 +6107,7 @@ private void InitializeComponent() // this.rjToggleButtonStyle.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); this.rjToggleButtonStyle.AutoSize = true; - this.rjToggleButtonStyle.Location = new Point(6, 347); + this.rjToggleButtonStyle.Location = new Point(9, 333); this.rjToggleButtonStyle.Margin = new Padding(3, 2, 3, 2); this.rjToggleButtonStyle.MinimumSize = new Size(39, 16); this.rjToggleButtonStyle.Name = "rjToggleButtonStyle"; @@ -6080,7 +6125,7 @@ private void InitializeComponent() label30.AutoSize = true; label30.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); label30.ForeColor = Color.Snow; - label30.Location = new Point(54, 348); + label30.Location = new Point(57, 334); label30.Name = "label30"; label30.Size = new Size(260, 30); label30.TabIndex = 108; @@ -6112,7 +6157,7 @@ private void InitializeComponent() label47.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); label47.AutoSize = true; label47.ForeColor = Color.Snow; - label47.Location = new Point(5, 418); + label47.Location = new Point(9, 425); label47.Name = "label47"; label47.Size = new Size(403, 15); label47.TabIndex = 84; @@ -6138,7 +6183,7 @@ private void InitializeComponent() label48.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); label48.AutoSize = true; label48.ForeColor = Color.Snow; - label48.Location = new Point(5, 403); + label48.Location = new Point(9, 410); label48.Name = "label48"; label48.Size = new Size(511, 15); label48.TabIndex = 85; @@ -6150,7 +6195,7 @@ private void InitializeComponent() richTextBoxAzureDict.Location = new Point(8, 60); richTextBoxAzureDict.Margin = new Padding(3, 2, 3, 2); richTextBoxAzureDict.Name = "richTextBoxAzureDict"; - richTextBoxAzureDict.Size = new Size(568, 160); + richTextBoxAzureDict.Size = new Size(568, 121); richTextBoxAzureDict.TabIndex = 63; richTextBoxAzureDict.Text = ""; // @@ -6160,7 +6205,7 @@ private void InitializeComponent() this.rjToggleButtonProfan.AutoSize = true; this.rjToggleButtonProfan.Checked = true; this.rjToggleButtonProfan.CheckState = CheckState.Checked; - this.rjToggleButtonProfan.Location = new Point(6, 285); + this.rjToggleButtonProfan.Location = new Point(9, 271); this.rjToggleButtonProfan.Margin = new Padding(3, 2, 3, 2); this.rjToggleButtonProfan.MinimumSize = new Size(39, 16); this.rjToggleButtonProfan.Name = "rjToggleButtonProfan"; @@ -6179,7 +6224,7 @@ private void InitializeComponent() label20.AutoSize = true; label20.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); label20.ForeColor = Color.Snow; - label20.Location = new Point(53, 284); + label20.Location = new Point(56, 270); label20.Name = "label20"; label20.Size = new Size(182, 15); label20.TabIndex = 48; @@ -6189,7 +6234,7 @@ private void InitializeComponent() // this.rjToggleButton4.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); this.rjToggleButton4.AutoSize = true; - this.rjToggleButton4.Location = new Point(5, 383); + this.rjToggleButton4.Location = new Point(9, 390); this.rjToggleButton4.Margin = new Padding(3, 2, 3, 2); this.rjToggleButton4.MinimumSize = new Size(39, 16); this.rjToggleButton4.Name = "rjToggleButton4"; @@ -6208,7 +6253,7 @@ private void InitializeComponent() label36.AutoSize = true; label36.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); label36.ForeColor = Color.Snow; - label36.Location = new Point(53, 383); + label36.Location = new Point(57, 390); label36.Name = "label36"; label36.Size = new Size(177, 15); label36.TabIndex = 82; @@ -6374,7 +6419,7 @@ private void InitializeComponent() this.iconButton29.IconFont = global::FontAwesome.Sharp.IconFont.Auto; this.iconButton29.IconSize = 40; this.iconButton29.ImageAlign = ContentAlignment.MiddleLeft; - this.iconButton29.Location = new Point(506, 2); + this.iconButton29.Location = new Point(455, 2); this.iconButton29.Margin = new Padding(3, 2, 3, 2); this.iconButton29.Name = "iconButton29"; this.iconButton29.Size = new Size(44, 46); @@ -10095,6 +10140,34 @@ private void InitializeComponent() button45.UseVisualStyleBackColor = true; button45.Click += this.button45_Click; // + // rjTogglePartialResults + // + this.rjTogglePartialResults.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); + this.rjTogglePartialResults.AutoSize = true; + this.rjTogglePartialResults.Location = new Point(9, 361); + this.rjTogglePartialResults.Margin = new Padding(3, 2, 3, 2); + this.rjTogglePartialResults.MinimumSize = new Size(39, 16); + this.rjTogglePartialResults.Name = "rjTogglePartialResults"; + this.rjTogglePartialResults.OffBackColor = Color.Gray; + this.rjTogglePartialResults.OffToggleColor = Color.Gainsboro; + this.rjTogglePartialResults.OnBackColor = Color.MediumSlateBlue; + this.rjTogglePartialResults.OnToggleColor = Color.WhiteSmoke; + this.rjTogglePartialResults.Size = new Size(39, 16); + this.rjTogglePartialResults.TabIndex = 124; + this.rjTogglePartialResults.UseVisualStyleBackColor = true; + // + // label203 + // + label203.Anchor = (AnchorStyles)((AnchorStyles.Bottom) | (AnchorStyles.Left)); + label203.AutoSize = true; + label203.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point); + label203.ForeColor = Color.Snow; + label203.Location = new Point(57, 362); + label203.Name = "label203"; + label203.Size = new Size(113, 15); + label203.TabIndex = 123; + label203.Text = "Allow Partial Results"; + // // VoiceWizardWindow // this.AutoScaleDimensions = new SizeF(7F, 15F); @@ -10917,6 +10990,11 @@ private void InitializeComponent() public TrackBar trackBarStyleExaggeration; private Label label202; private Button button22; + private Label label201; + public TextBox textBoxDelayBeforeAudio; + private Button button21; + public global::OSCVRCWiz.RJControls.RJToggleButton rjTogglePartialResults; + private Label label203; // public FontAwesome.Sharp.IconButton iconButton2; } } \ No newline at end of file diff --git a/OSCVRCWiz/VoiceWizardWindow.cs b/OSCVRCWiz/VoiceWizardWindow.cs index b156b5df..ff303bfb 100644 --- a/OSCVRCWiz/VoiceWizardWindow.cs +++ b/OSCVRCWiz/VoiceWizardWindow.cs @@ -1810,13 +1810,13 @@ private void rjToggleButtonAutoRefreshKAT_CheckedChanged(object sender, EventArg private void comboBoxPara_SelectedIndexChanged(object sender, EventArgs e) { - this.Invoke((MethodInvoker)delegate () - { - OutputText.numKATSyncParameters = comboBoxPara.SelectedItem.ToString(); - Settings1.Default.SyncParaValue = comboBoxPara.SelectedIndex; + // this.Invoke((MethodInvoker)delegate () + // { + OutputText.numKATSyncParameters = comboBoxPara.SelectedItem.ToString(); + Settings1.Default.SyncParaValue = comboBoxPara.SelectedIndex; - Settings1.Default.Save(); - }); + //Settings1.Default.Save(); + // }); } @@ -2098,6 +2098,13 @@ private void button14_Click(object sender, EventArgs e) textBoxCustomSpot.Text = currentText; } + private void button21_Click(object sender, EventArgs e) + { + string currentText = textBoxCustomSpot.Text.ToString(); + currentText = currentText + "{nline}"; + textBoxCustomSpot.Text = currentText; + } + private void comboBoxMediaPreset_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxMediaPreset.SelectedIndex == 0) @@ -2132,6 +2139,11 @@ private void buttonExportMedia_Click(object sender, EventArgs e) Import_Export.ExportList("Output\\Exports", "MediaPreset", MediaPresets.mediaPresetsStored); } + private void button22_Click_1(object sender, EventArgs e) + { + SpotifyAddon.printMediaOnce(); + } + #endregion #region OSCListener @@ -3071,11 +3083,6 @@ private void whisperLink_Click(object sender, EventArgs e) #endregion - - private void button22_Click_1(object sender, EventArgs e) - { - SpotifyAddon.printMediaOnce(); - } }