想要電腦讀出我們寫的內容,在win10,很簡單?
其實這個技術在windows7就有了,但是現在win10讓寫出一個你寫我讀的軟件很簡單。?
我們需要一個類`MediaElement`來播放,因為windows10的Markdown軟件用的不是很好,所有我自己寫一個。?
這個軟件我用了你寫我讀,[https://github.com/lindexi/Markdown](https://github.com/lindexi/Markdown)?

點擊?讀出文本
在使用`SpeechSynthesizer`需要代碼功能點麥克風


代碼我放在model?
代碼很少就可以你寫我讀
~~~
private async void speech(string str, MediaElement media_element)
{
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
SpeechSynthesisStream stream = await synthesizer.SynthesizeTextToStreamAsync(str);
media_element.SetSource(stream, stream.ContentType);
media_element.Play();
}
~~~
實例化`SpeechSynthesizer`,使用`SynthesizeTextToStreamAsync`把文本變為流
可以使用`MediaElement`播放,`MediaElement`播放需要把流和格式放到`MediaElement`
~~~
media_element.Play();
~~~
~~~
<MediaElement Grid.Row="0" x:Name="mediaelement" AutoPlay="True" Volume="1.0" />
~~~
Volume 聲音
參考:[http://www.cnblogs.com/tcjiaan/](http://www.cnblogs.com/tcjiaan/)
- 前言
- UWP win10 app 新關鍵字x:Bing
- win10應用 UWP 使用MD5算法
- win10 UWP讀寫文件
- UWP appButtonBar樣式
- C# 6.0 $&quot;Hello {csdn}&quot;
- Win10 UWP xaml 延遲加載元素
- UWP xaml 圓形頭像
- UWP 繪制圖形
- win10 uwp 通知Toast
- win10 UWP 顯示地圖
- win10 uwp 參考
- win10 uwp clone
- win10 uwp 裝機必備應用 含源代碼
- RichEditBox 使用自定義菜單
- win10 UWP FlipView
- win10 UWP 獲取系統信息
- win10 UWP 申請微軟開發者
- win10 UWP button
- win10 UWP Markdown 含源代碼
- win10 UWP 應用設置
- win10 UWP 九幽數據分析
- win10 UWP 圓形等待
- win10 UWP 標題欄后退
- win10 UWP 單元測試
- win10 UWP 你寫我讀
- win10 UWP RSS閱讀器
- win10 UWP MessageDialog 和 ContentDialog
- win10 UWP Hmac
- win10 UWP GET Post
- Win10 UWP Intro to controls and events
- win10 UWP Controls by function
- win10 uwp App-to-app communication 應用通信