Skip to content

Commit

Permalink
Merge pull request #85 from VRCWizard/update-v1.7.3
Browse files Browse the repository at this point in the history
update v1.7.3
  • Loading branch information
VRCWizard authored Jan 18, 2025
2 parents 6cbe2bf + 494322d commit 4c6e650
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion OSCVRCWiz/Resources/StartUp/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OSCVRCWiz.Resources.StartUp
public class Updater
{

public static string currentVersion = "1.7.2";
public static string currentVersion = "1.7.3";
public static string updateXMLName = "https://github.com/VRCWizard/TTS-Voice-Wizard/releases/latest/download/AutoUpdater-x64.xml";

public static async void getGithubInfo()
Expand Down
3 changes: 2 additions & 1 deletion OSCVRCWiz/Services/Integrations/Media/SpotifyAddon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ public static async Task spotifyGetCurrentSongInfo(bool playOnce)

artist = m_currentTrack.Artists[0].Name.ToString();

if(title == "Advertisement" && artist =="")
if(title == "Advertisement")
{
title = "";
artist = "";
}


Expand Down
17 changes: 16 additions & 1 deletion OSCVRCWiz/Services/Integrations/WordReplacements.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using static OSCVRCWiz.VoiceWizardWindow;
using System.Text.RegularExpressions;
using OSCVRCWiz.Services.Text;
using System.Windows.Input;

namespace OSCVRCWiz.Services.Integrations
{
Expand Down Expand Up @@ -28,9 +29,23 @@ public static string MainDoWordReplacement(string text)
{

string pattern = Regex.Escape(kvp.Key.ToString());
string key = kvp.Key.ToString();
if (VoiceWizardWindow.MainFormGlobal.rjToggleUseWordBoundaries.Checked)
{
pattern = $@"\b{Regex.Escape(kvp.Key.ToString())}\b";
// pattern = $@"\b{Regex.Escape(kvp.Key.ToString())}\b"; //does not work if the word starts with a special character like $
// pattern = $@"(?<!\S){Regex.Escape(kvp.Key.ToString())}(?!\S)"; //no longer works if punctuation is touching the word...
// pattern = $@"(?<![\w]){Regex.Escape(kvp.Key.ToString())}(?![\w])";

if (char.IsLetterOrDigit(key[0]) || key[0] == '_') // Word characters: [a-zA-Z0-9_]
{
// Use standard word boundary pattern
pattern = $@"\b{Regex.Escape(key)}\b";
}
else
{
// Use custom pattern for special characters
pattern = $@"(?<![\w]){Regex.Escape(key)}(?![\w])";
}
}
text = Regex.Replace(text, pattern, kvp.Value.ToString(), RegexOptions.IgnoreCase);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ public static async Task SynthesisGetAvailableVoicesAsync(ComboBox voices, strin
voices.Items.Add("onyx");
voices.Items.Add("nova");
voices.Items.Add("shimmer");
//voices.Items.Add("ash");
//voices.Items.Add("ballad");
//voices.Items.Add("coral");
//voices.Items.Add("sage");
//voices.Items.Add("verse");
voices.SelectedIndex = 0;


Expand Down
11 changes: 10 additions & 1 deletion OSCVRCWiz/Services/Speech/TranslationAPIs/DeepLTranslate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ public static async Task<string> translateTextDeepL(string text)
catch (Exception ex)
{
//MessageBox.Show("DeepL Translation Error: " + ex.Message);
OutputText.outputLog("[Translation API Error: " + ex.Message + "]", Color.Red);
// OutputText.outputLog("[Translation API Error: " + ex.Message + "]", Color.Red);
var errorMsg = ex.Message + "\n" + ex.TargetSite + "\n\nStack Trace:\n" + ex.StackTrace;

try
{
errorMsg += "\n\n" + ex.InnerException.Message + "\n" + ex.InnerException.TargetSite + "\n\nStack Trace:\n" + ex.InnerException.StackTrace;

}
catch { }
OutputText.outputLog("[DeepL Translation Error: " + errorMsg + "]", Color.Red);
OutputText.outputLog("[You are attempting to translate from one language to another. If this is not your intent then switch 'Translation Language' back to 'No Translation (Default)'. If you are intending to translate then get a VoiceWizardPro key or a DeepL key. ]", Color.DarkOrange);
OutputText.outputLog("[Learn how to get a Language Translation Key: https://ttsvoicewizard.com/docs/Translation/DeepL ]", Color.DarkOrange);
return "";
Expand Down
4 changes: 2 additions & 2 deletions OSCVRCWiz/VoiceWizardWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c6e650

Please sign in to comment.