diff --git a/README.md b/README.md
index 7859bd5..8933f85 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,18 @@
+
+
+
+
+
+
+
+
+
STranslate
@@ -24,6 +33,7 @@
- [x] 添加开机自启
- [x] 添加亮/暗主题
- [x] 添加 UI 设置缓存(用户目录下 `AppData\Local\STranslate`)
+- [x] 添加语音合成
- [ ] 添加 OCR 翻译
- [ ] 添加翻译记录缓存功能
@@ -58,4 +68,4 @@
[https://github.com/NPCDW/WpfTool](https://github.com/NPCDW/WpfTool)
-[https://github.com/zu1k/removed-2022-07-12/releases/tag/0.1.2](https://github.com/zu1k/removed-2022-07-12/releases/tag/0.1.2)
\ No newline at end of file
+[https://github.com/zu1k/removed-2022-07-12/releases/tag/0.1.2](https://github.com/zu1k/removed-2022-07-12/releases/tag/0.1.2)
diff --git a/STranslate/Images/iconfont.ttf b/STranslate/Images/iconfont.ttf
index 5bcdb90..839570f 100644
Binary files a/STranslate/Images/iconfont.ttf and b/STranslate/Images/iconfont.ttf differ
diff --git a/STranslate/MainWindow.xaml b/STranslate/MainWindow.xaml
index 9fcaaee..8164fdf 100644
--- a/STranslate/MainWindow.xaml
+++ b/STranslate/MainWindow.xaml
@@ -71,6 +71,9 @@
+
@@ -99,6 +102,7 @@
@@ -124,6 +129,9 @@
+
+
diff --git a/STranslate/Style/Dark/DictionaryButtonDark.xaml b/STranslate/Style/Dark/DictionaryButtonDark.xaml
index ea619a4..431bf1c 100644
--- a/STranslate/Style/Dark/DictionaryButtonDark.xaml
+++ b/STranslate/Style/Dark/DictionaryButtonDark.xaml
@@ -81,6 +81,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
true, (_) =>
+ {
+ Speech.SpeakAsync(InputTxt);
+ });
+ //target speak
+ TargetSpeakCmd = new RelayCommand((_) => true, (_) =>
+ {
+ Speech.SpeakAsync(OutputTxt);
+ });
//复制输入
CopyInputCmd = new RelayCommand((_) => true, (_) =>
{
@@ -233,12 +244,15 @@ namespace STranslate.ViewModel
public void Dispose()
{
+ Speech.Dispose();
WriteConfig();
}
#endregion handle
#region Params
private string translateResp;
+ public ICommand SourceSpeakCmd { get; private set; }
+ public ICommand TargetSpeakCmd { get; private set; }
public ICommand TranslateCmd { get; private set; }
public ICommand CopyInputCmd { get; private set; }
public ICommand CopyResultCmd { get; private set; }
@@ -300,6 +314,12 @@ namespace STranslate.ViewModel
private Server _SelectedTranslationInterface;
public Server SelectedTranslationInterface { get => _SelectedTranslationInterface; set => UpdateProperty(ref _SelectedTranslationInterface, value); }
private static Dictionary LanguageEnumDict { get => Util.Util.GetEnumList(); }
+
+ ///
+ /// 语音
+ ///
+ public readonly SpeechSynthesizer Speech = new SpeechSynthesizer();
+
private static readonly string _ThemeDark = "pack://application:,,,/STranslate;component/Style/Dark.xaml";
private static readonly string _ThemeDefault = "pack://application:,,,/STranslate;component/Style/Default.xaml";
#endregion Params
diff --git a/example.png b/example.png
index 6a0db3b..335b900 100644
Binary files a/example.png and b/example.png differ
diff --git a/example_dark.png b/example_dark.png
index 1811935..bd12057 100644
Binary files a/example_dark.png and b/example_dark.png differ