把textbox1中的文字读出来

zxj2634 2010-10-15 05:30:36
发出声音的那种,可以实现么
...全文
182 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
sirzxj 2010-11-11
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20091001/02/da31288a-5a39-49a5-970b-cedc534bef2f.html
C#朗读文章
http://blog.csdn.net/wkjs/archive/2007/06/18/1656350.aspx
fangxqian 2010-10-17
  • 打赏
  • 举报
回复
private void button1_Click(object sender, EventArgs e)
{
SoundPlayer win = new SoundPlayer(Application.StartupPath + "\\dog.wav"); //
win = null;
string str = this.textBox1.Text;
// MessageBox.Show(n.ToString());
for (int i = 0; i < str.Length; i++)
{
int keyAscii = int.Parse(str.Substring(i, 1)); //截取从i开始的1位字符
//MessageBox.Show(keyAscii.ToString());

switch (keyAscii)
{

case 1:
win = new SoundPlayer(Application.StartupPath + "\\1.wav"); //取语音值
break;
case 2:
win = new SoundPlayer(Application.StartupPath + "\\2.wav");
break;
case 3:
win = new SoundPlayer(Application.StartupPath + "\\3.wav");
break;
case 4:
win = new SoundPlayer(Application.StartupPath + "\\4.wav");
break;
case 5:
win = new SoundPlayer(Application.StartupPath + "\\5.wav");
break;
case 6:
win = new SoundPlayer(Application.StartupPath + "\\6.wav");
break;

case 7:
win = new SoundPlayer(Application.StartupPath + "\\7.wav");
break;
case 8:
win = new SoundPlayer(Application.StartupPath + "\\8.wav");
break;
case 9:
win = new SoundPlayer(Application.StartupPath + "\\9.wav");
break;
case 0:
win = new SoundPlayer(Application.StartupPath + "\\0.wav");
break;
default:
break;

}
if (win != null)

win.Play();

System.Threading.Thread.Sleep(500);//线程被延时的毫秒数
}


}
jcrensheng 2010-10-15
  • 打赏
  • 举报
回复
我也正要用这个,希望楼主解决了给参考一下
flyerwing 2010-10-15
  • 打赏
  • 举报
回复
可以的.
好象有那个东西的没用过帮顶了!
jce195447 2010-10-15
  • 打赏
  • 举报
回复
VBS脚本
Set objVoice = CreateObject("SAPI.SpVoice")
Do while TRUE
Input = InputBox("请输入要讲的话","语音合成器")
if Input = "" then
WScript.Quit
elseif Input = " " then
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
board = objIE.document.parentwindow.clipboardData.GetData("text")
objIE.Quit
Str = replace(board,chr(10),"。。")
objVoice.Speak Str
else
objVoice.Speak Input
end if
loop
Sevencrimes 2010-10-15
  • 打赏
  • 举报
回复
这应该设计其他技术了吧
jce195447 2010-10-15
  • 打赏
  • 举报
回复
写个脚本 调用WINDOWS的朗读程序即可。
兔子-顾问 2010-10-15
  • 打赏
  • 举报
回复
C#朗读文章
http://blog.csdn.net/wkjs/archive/2007/06/18/1656350.aspx
zxj2634 2010-10-15
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 zerodegrees 的回复:]
textBox1.Text
[/Quote]
朗读出来,大哥
zerodegrees 2010-10-15
  • 打赏
  • 举报
回复
textBox1.Text
zxj2634 2010-10-15
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ly_longyue 的回复:]
可以啊。
[/Quote]

要方法,是疑问,不是判断

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧