internal static void TTS(string text, string localization = "zh") { string tts = System.Web.HttpUtility.UrlEncode(text, System.Text.Encoding.UTF8); WebApi.Download($"https://fanyi.baidu.com/gettts?lan={localization}&text={tts}&spd=4&source=web", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Global.APPNAME, "tts_cache", $"{localization}_{tts}.mp3")); Play(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Global.APPNAME, "tts_cache", $"{localization}_{tts}.mp3")); }
private void checkBox_tracker_enabled_CheckedChanged(object sender, EventArgs e) { Settings.TrackerEnabled = checkBox_tracker_enabled.Checked; Settings.Save(); if (Settings.TrackerEnabled) { if (File.Exists("node.dll") || File.Exists($@"{Environment.GetEnvironmentVariable("windir")}\node.dll")) { TrackerForm = new TrackerForm(this); TrackerFormLoaded = true; TrackerForm.Show(); } else { TrackerFormLoaded = false; checkBox_tracker_enabled.Enabled = false; ShowNotification("notification-dll-missing", "node.dll"); Task.Factory.StartNew(() => { WebApi.Download($"http://svn.diemoe.net/ff14_diemoe/tags/DFAssist_CN/dll/node.dll", $@"{Environment.GetEnvironmentVariable("windir")}\node.dll", true, nodedll_callback); }); } } else { tracker_close(); } button_tracker_open.Enabled = TrackerFormLoaded; }
internal static void TTS(string text, string localization = "zh") { string tts = System.Web.HttpUtility.UrlEncode(text, System.Text.Encoding.UTF8); string tmp = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Global.APPNAME, "tts_cache", $"{localization}_{tts}.mp3"); if (File.Exists(tmp) && Settings.TTSCache == "0") { WebApi.Download($"https://fanyi.baidu.com/gettts?lan={localization}&text={tts}&spd={Settings.TTSSpeed}&source=web", tmp, true); } else if (!File.Exists(tmp)) { WebApi.Download($"https://fanyi.baidu.com/gettts?lan={localization}&text={tts}&spd={Settings.TTSSpeed}&source=web", tmp); } Play(tmp, "TTS", Settings.TTSVol * 10); }