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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - harry.guo

转:Codeigniter调用PHPExcel例子 转:iphone/ipad网站开发技巧整理 转:iPhone Android Web开发(概要) 转:jquery弹出层背景变暗 - harry.guo - 博客园 转载:Android模拟器的基本操作 安装android sdk 遇到几个问题 基础:JDK的概念、组成及JDK常用包(转) 基础:JDK与JRE(转) 基础:C#装箱拆箱的计算 转:对比MFC,Winform,WPF - harry.guo 正则在FireFox和IE下使用test的不同 - harry.guo 格式化日期输出 - harry.guo 知识:软件复杂度 - harry.guo 转:如何让你的SQL运行得更快 - harry.guo 白盒测试步骤 - harry.guo Ms时间处理收集 - harry.guo [摘]javascript的Prototype实现和OO开发- - - harry.guo java实现对文件的各种操作(转) - harry.guo 实现table跳转到指定行,并改变所在行的样式! - harry.guo
转:c#播放音频文件 - harry.guo - 博客园
harry.guo · 2010-10-12 · via 博客园 - harry.guo

c#播放音频文件

首先将C:\WINDOWS\system32下的wmp.dll应用到项目中;

WMPLib.WindowsMediaPlayerClass player = new WMPLib.WindowsMediaPlayerClass();
            player.URL 
= @"F:\ding.wav";
            player.uiMode 
= "None";
            player.settings.volume 
= 100;
            player.settings.playCount 
= 1;
            player.play();

WMPLib.WindowsMediaPlayer 的用法

属性/方法名: 说明: 
[基本属性]   
URL: String; 指定媒体位置,本机或网络地址 
uiMode:String; 播放器界面模式,可为Full, Mini, None, Invisible 
playState:integer; 播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,10=准备就绪 
enableContextMenu:Boolean; 启用/禁用右键菜单 
fullScreen:boolean; 是否全屏显示 
[controls] wmp.controls //播放器基本控制 
controls.play; 播放 
controls.pause; 暂停 
controls.stop; 停止 
controls.currentPosition:double; 当前进度 
controls.currentPositionString:string; 当前进度,字符串格式。如“00:23” 
controls.fastForward; 快进 
controls.fastReverse; 快退 
controls.next; 下一曲 
controls.previous; 上一曲 
[settings] wmp.settings //播放器基本设置 
settings.volume:integer; 音量,0-100 
settings.autoStart:Boolean; 是否自动播放 
settings.mute:Boolean; 是否静音 
settings.playCount:integer; 播放次数 
[currentMedia] wmp.currentMedia //当前媒体属性 
currentMedia.duration:double; 媒体总长度 
currentMedia.durationString:string; 媒体总长度,字符串格式。如“03:24” 
currentMedia.getItemInfo(const string); 获取当前媒体信息"Title"=媒体标题,"Author"=艺术家,"Copyright"=版权信息,"Description"=媒体内容描述,"Duration"=持续时间(秒),"FileSize"=文件大小,"FileType"=文件类型,"sourceURL"=原始地址 
currentMedia.setItemInfo(const string); 通过属性名设置媒体信息 
currentMedia.name:string; 同 currentMedia.getItemInfo("Title") 
[currentPlaylist] wmp.currentPlaylist //当前播放列表属性 
currentPlaylist.count:integer; 当前播放列表所包含媒体数 
currentPlaylist.Item[integer]; 获取或设置指定项目媒体信息,其子属性同wmp.currentMedia

循环播放:currentMedia.settings.setMode("loop", true);

取消循环:currentMedia.settings.setMode("loop", false);