Skip to content

Commit

Permalink
Merge pull request #57 from VRCWizard/VRCWizard-patch-4
Browse files Browse the repository at this point in the history
Vrc wizard patch 4
  • Loading branch information
VRCWizard authored Oct 23, 2023
2 parents 63ac97f + 2963332 commit e0e7618
Show file tree
Hide file tree
Showing 16 changed files with 1,007 additions and 799 deletions.
Binary file modified OSCVRCWiz/App.config
Binary file not shown.
10 changes: 10 additions & 0 deletions OSCVRCWiz/Resources/Audio/AudioDevices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion OSCVRCWiz/Resources/StartUp/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.9";
public static string updateXMLName = "https://github.com/VRCWizard/TTS-Voice-Wizard/releases/latest/download/AutoUpdater-x64.xml";

public static async void getGithubInfo()
Expand Down
8 changes: 6 additions & 2 deletions OSCVRCWiz/Services/Integrations/Heartrate/HeartratePulsoid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ private static async void doHeartrateTimerTick()
var message3 = new CoreOSC.OscMessage("/avatar/parameters/hundredsHR", hundreds);
OSC.OSCSender.Send(message3);

float HRPercent = (float)currentHR / 256;
var message4 = new CoreOSC.OscMessage("/avatar/parameters/HRPercent", (float)HRPercent);
OSC.OSCSender.Send(message4);



// Debug.WriteLine(currentHR + "--" + HRPrevious);
Expand Down Expand Up @@ -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));


}
Expand Down
14 changes: 10 additions & 4 deletions OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -225,12 +226,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)
Expand All @@ -241,6 +242,8 @@ public static async Task spotifyGetCurrentSongInfo(bool playOnce)

// lastSong = title;
// MainForm.justShowTheSong = false;
SpotifyAddon.lastSong = SpotifyAddon.title;
// WindowsMedia.previousTitle = WindowsMedia.mediaTitle;
fullSongPauseCheck = progress;


Expand Down Expand Up @@ -348,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());
Expand Down Expand Up @@ -419,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());
Expand Down Expand Up @@ -449,18 +454,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;

}

Expand Down
6 changes: 3 additions & 3 deletions OSCVRCWiz/Services/Integrations/OSCListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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


}
Expand Down
8 changes: 4 additions & 4 deletions OSCVRCWiz/Services/Integrations/VRChatListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions OSCVRCWiz/Services/Speech/DoSpeech.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading

0 comments on commit e0e7618

Please sign in to comment.