返回信息流一个读英文的东东!
运行环境:.Net 2.0 + Microsoft Speech API
使用方法:
1.Interactive Mode: 直接打开,在提示符下输入的字符会被读出来
2.File Mode: 拖几个文本文件扔到主程序上,文本内容会被读出来
Known Issues:
1. Chinese Have NOT been Supported
2. Sometimes Initialize Speech engine consume a lot of time!
3. A lot of other bugs haven't been figure out!
主程序
附件(41.5KB) TextReader.rar
此为一个测试文本
附件(298B) Test.txt
这是一条镜像帖。来源:北邮人论坛 / soft-design / #17046同步于 2007/4/24
该镜像源已超过 30 天没有更新,可能在源站已被删除。
SoftDesign机器人发帖
【Origin】某日的无聊产物,拿出来晾晾——Windy Text Reader
TimNew
2007/4/24镜像同步12 回复
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
忘了 Source code VS 2005 C#
【 在 TimNew 的大作中提到: 】
: 一个读英文的东东!
: 运行环境:.Net 2.0 + Microsoft Speech API
: 使用方法:
: ...................
.NET的运行程序好像跟传统可执行Windows程序格式不一样 需要运行在框架下
【 在 RemoteFish (RemoteFish) 的大作中提到: 】
: 那就只赞一下好了。话说这东东能把运行库静态编译进去吗,或者,有没有什么打包程序能够寻找它依赖的库并一并打包?
using SpeechLib;
using System;
using System.IO;
using System.Text;
namespace TextReader
{
internal class Program
{
private static SpVoice Speaker = new SpVoiceClass();
private static void InteractSpeak()
{
Console.WriteLine("Interactive Mode...\r\nEntry \"<Quit>\" to quit");
while (true)
{
Console.Write("> ");
string text = Console.ReadLine();
if (text.Trim().ToUpper() == "<QUIT>")
{
return;
}
Speaker.Speak(text, SpeechVoiceSpeakFlags.SVSFDefault);
}
}
private static void Main(string[] args)
{
Console.WriteLine("Windy's Text Reader");
Console.WriteLine("Copyleft (c) TimNew-D 2007/3/20");
Console.WriteLine("Powered by Microsoft Speech API");
Console.WriteLine();
Speaker.Speak("Windy's Text Reader... Copy left. Tim New Dee... March Twentieth 2007... Powered by Microsoft Speech API", SpeechVoiceSpeakFlags.SVSFDefault);
if (args.Length == 0)
{
InteractSpeak();
}
foreach (string text in args)
{
if (File.Exists(text))
{
ReadFile(text);
}
else
{
Console.WriteLine("\r\nERROR: File '{0}' not Found.", text);
}
}
Console.WriteLine();
Console.WriteLine("\r\nWindy Text Reader Exiting...");
}
private static void ReadFile(string FoString)
{
StreamReader reader = new StreamReader(FoString, Encoding.Default, true);
Console.WriteLine("\r\nReading File: {0}...", FoString);
while (!reader.EndOfStream)
{
Speaker.Speak(reader.ReadLine(), SpeechVoiceSpeakFlags.SVSFDefault);
}
}
}
}
有啥好Show的?
【 在 Lonhero 的大作中提到: 】
: using SpeechLib;
: using System;
: using System.IO;
: ...................
我说了是某日无聊的东东了嘛~
如果我告诉你这东东原来是一个PowerShell的脚本你会不会吃惊呢?
而且这个东东的关键不在于代码,关键在于里面那个COM库!以及那个Demo,txt,好好听听里面都是些什么?[em21]
【 在 coolfantasy 的大作中提到: 】
: .NET的运行程序好像跟传统可执行Windows程序格式不一样 需要运行在框架下
我懒得打包了,不然打包以后可以脱离.Net库的(其实是把.net库打包到安装包里了),就像移动的飞信那样