惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
Martin Fowler
Martin Fowler
G
Google Developers Blog
F
Fortinet All Blogs
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Google Online Security Blog
Google Online Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tailwind CSS Blog
Cloudbric
Cloudbric
U
Unit 42
MyScale Blog
MyScale Blog
TaoSecurity Blog
TaoSecurity Blog
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
博客园 - Franky
AI
AI
爱范儿
爱范儿
L
LangChain Blog
小众软件
小众软件
D
DataBreaches.Net
M
MIT News - Artificial intelligence
GbyAI
GbyAI
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Cloudflare Blog
Help Net Security
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
A
About on SuperTechFans
Scott Helme
Scott Helme
The GitHub Blog
The GitHub Blog
V
V2EX
N
Netflix TechBlog - Medium
S
Security Affairs
Security Archives - TechRepublic
Security Archives - TechRepublic
H
Heimdal Security Blog
WordPress大学
WordPress大学

博客园 - 君

50口诀让你轻松记四六级单词 苦瓜炒蛋 随笔 将货币数字描述转化成中文描述 - 君 - 博客园 年旦前 经历一劫 2007-12-16 随缘也 留脚 一篇不错的文章 .net修改网络配置,如IP,DNS等 .net写发送邮件工具 2007-2-3 2006-12-23 .NET中获取系统硬件信息 网站宣传 DotNetMagic做应用程序界面(类似office2003风格) Grove——.NET中的ORM实现(转载,学习...........)
用C#播放声音文件
· 2006-10-25 · via 博客园 - 君

为了系统人性话,更加智能,有时候需要一些声音辅助系统
下面这个例子可以播放指定音频文件,而且还可以读字符串:

/// <summary>

        /// 播放声音文件

        /// </summary>

        /// <param name="FileName">文件全名</param>

        public void PlaySound(string FileName)

        {//要加载COM组件:Microsoft speech object Library

            if (!System.IO.File.Exists(FileName))

            {

                return;

            }

            SpeechLib.SpVoiceClass pp = new SpeechLib.SpVoiceClass();

            SpeechLib.SpFileStreamClass spFs = new SpeechLib.SpFileStreamClass();

            spFs.Open(FileName, SpeechLib.SpeechStreamFileMode.SSFMOpenForRead, true);

            SpeechLib.ISpeechBaseStream Istream = spFs as SpeechLib.ISpeechBaseStream;

            pp.SpeakStream(Istream, SpeechLib.SpeechVoiceSpeakFlags.SVSFIsFilename);

            spFs.Close();

        }