Text to speech语音 Windows phone
2015-12-26 13:04
369 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Phone.Speech.Synthesis;
namespace Flashcard
{
class Text_to_speech
{
private static Text_to_speech uniqueInstance;
private SpeechSynthesizer _speechSynthesizer;//声明音响合成器
private Text_to_speech() {
_speechSynthesizer = new SpeechSynthesizer();
}
public static Text_to_speech getInstance() {
if (uniqueInstance == null) {
uniqueInstance = new Text_to_speech();
}
return uniqueInstance;
}
public async void _text_to_speak(string text) {
try {
if (!string.IsNullOrEmpty(text))
{
await _speechSynthesizer.SpeakTextAsync(text);
}
else {
}
}
catch(Exception ex){
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Phone.Speech.Synthesis;
namespace Flashcard
{
class Text_to_speech
{
private static Text_to_speech uniqueInstance;
private SpeechSynthesizer _speechSynthesizer;//声明音响合成器
private Text_to_speech() {
_speechSynthesizer = new SpeechSynthesizer();
}
public static Text_to_speech getInstance() {
if (uniqueInstance == null) {
uniqueInstance = new Text_to_speech();
}
return uniqueInstance;
}
public async void _text_to_speak(string text) {
try {
if (!string.IsNullOrEmpty(text))
{
await _speechSynthesizer.SpeakTextAsync(text);
}
else {
}
}
catch(Exception ex){
}
}
}
}
相关文章推荐
- Text to speech语音 Windows phone
- 单链表的插入与删除
- 对绩效的重新理解
- 用小米路由搭建外网可访问的个人网站
- ionic调用键盘搜索功能轻松实现
- 如何把应用程序app编译进android系统
- LWIP 无操作系统的移植
- 关于递归
- linux硬链接与软链接
- Hadoop:Partitioner的应用
- json解析
- MinGW和Cgywin的区别
- 第十一章:图形、图像与动画
- MVC4中AJAX Html页面打开调用后台方法实现动态载入数据库中的数据
- iOS开源项目汇总
- 如何判断文件是否有重复的行?------ sort和uniq搞起
- PCA
- Java随机生成验证码
- 11.Android之常用对话框AlertDialog学习