当前位置: 首页 > news >正文

孝感市门户网站优化什么

孝感市门户网站,优化什么,网站建设企业网的项目描述,国际财经新闻最新头条Windows有文字转语音功能,C#提供了调用的类库Interop.SpeechLib.dll 使用方法很简单,在你的项目中添加Interop.SpeechLib.dll引用,在类中引用: using SpeechLib;这里提供一个CVoice类 帮助实现语音播报 public class CVoice{pri…

Windows有文字转语音功能,C#提供了调用的类库Interop.SpeechLib.dll

使用方法很简单,在你的项目中添加Interop.SpeechLib.dll引用,在类中引用:

using SpeechLib;

这里提供一个CVoice类 帮助实现语音播报

 public class CVoice{private static Speach mysp = Speach.instance();private static SoundPlayer _voiceplayer = new SoundPlayer();private static Thread threadplay;private static string _sound;public static string SoundfileName{get { return _sound; }}private static string _soundtext;public static string SoundText{get { return CVoice._soundtext; }}public static void Playfile(string soundfile){_sound = soundfile;threadplay = new Thread(mysoundplay);threadplay.Start();}public static void Play(string soundtext){try{_soundtext = soundtext.Replace("重", "虫");  //解决都“zhong”的问题mysp.AnalyseSpeak(soundtext);}catch{}}public static void RePlay() //播放最后一次的语音{mysp.AnalyseSpeak(_soundtext);}public static void Pause() //播放最后一次的语音{mysp.Pause();}public static void Continue() //播放最后一次的语音{mysp.Continue();}public static void Stop(){//if (threadplay.ThreadState == ThreadState.Running)//{//    threadplay.Abort();//}mysp.Stop();}private static void mysoundplay(){try{_voiceplayer.SoundLocation = _sound;_voiceplayer.Play();}catch{}}public static Speach Speech{get{return mysp;}}}public class Speach{private static Speach _Instance = null;private SpeechLib.SpVoiceClass voice = null;private Speach(){BuildSpeach();}public static Speach instance(){if (_Instance == null)_Instance = new Speach();return _Instance;}public void SelectVoice(int index){try{voice.Voice = voice.GetVoices("", "").Item(index);}catch{}}private void BuildSpeach(){if (voice == null) voice = new SpVoiceClass();SelectVoice(0);}public int Volume{get{return voice.Volume;}set{voice.SetVolume((ushort)(value));}}public int Rate{get{return voice.Rate;}set{voice.SetRate(value);}}private void Speak(string strSpeack){try{int nn = voice.Speak(strSpeack.Replace("重", "虫"), SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync);Console.WriteLine(nn);}catch (Exception err){throw (new Exception("发生一个错误:" + err.Message));}}public void AnalyseSpeak(string strSpeak){Speak(strSpeak);}public void Stop(){voice.Speak(string.Empty, SpeechLib.SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak);}public void Pause(){voice.Pause();}public void Continue(){voice.Resume();}}在需要的地方只需要CVoice.Play(“语音播报内容”);
需要dll文件的私聊我!
http://www.wooajung.com/news/21036.html

相关文章:

  • 东凤镇做网站公司谷歌广告优化
  • 网站好处公司网站怎么做
  • wordpress文章查看次数网页搜索引擎优化技术
  • 怎样做后端数据传输前端的网站大数据精准营销获客
  • wordpress页面响应慢如何优化关键词排名快速首页
  • 河源建网站百度竞价广告的位置
  • 养老网站建设的意义软文案例500字
  • 选择网站做友情链接的标准一般是免费开通网站
  • 租个国内服务器做网站多少钱关键词竞价广告
  • 做网站空间torrentkitty搜索引擎
  • 上海网站制作设计公司seo分析及优化建议
  • wordpress 3.0.1 漏洞seo专员是什么职业
  • 做购物网站能赚钱吗竞价托管服务公司
  • 做网站需要下载哪些软件湖南企业竞价优化首选
  • 百度怎样才能搜到自己的网站十大嵌入式培训机构
  • 临沂网站推广排名搭建一个网站需要多少钱?
  • 电商设计师网站app推广员好做吗
  • 做网站图片教程seo视频教程百度网盘
  • 香港网站维护公司如何建立网站平台
  • 中卫网架钢结构东莞百度推广优化
  • 做网站日ip100免费网页制作网站
  • 宜家有做自己的网站吗广西壮族自治区人民医院
  • 大馆陶网站百度不收录网站
  • 桂林网站开发建设比较好的网络推广平台
  • 有哪些网站做生鲜到家关键词可以分为哪三类
  • 阿里云备案网站备案域名太原百度快照优化排名
  • 呼和浩特市城乡建设委员的网站网络推广是啥
  • 四川网上注册公司流程杭州seo优化
  • 网站架构优化小网站
  • 有原型怎么做网站搜狗seo