社区
C#
帖子详情
如何播放音频文件(avi,mp3等)??
Cango
2003-08-29 03:44:14
UP
...全文
43
9
打赏
收藏
如何播放音频文件(avi,mp3等)??
UP
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
qinb
2003-08-29
打赏
举报
回复
direct90sdk中有实例,从微软下吧
panyee
2003-08-29
打赏
举报
回复
最简单的方法就是直接把媒体播放器的控件拖到窗体上来,
雪狼1234567
2003-08-29
打赏
举报
回复
这儿有源码?
http://www.codeguru.com/cs_graphics/WavPlay.html
雪狼1234567
2003-08-29
打赏
举报
回复
public class Form1 : System.Windows.Forms.Form
{
double shu;
double temps1;
double temps2;
double jg;
double save;
double zf;
string js;
bool gl;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button14;
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button16;
private System.Windows.Forms.Button button17;
private System.Windows.Forms.Button button18;
private System.Windows.Forms.Button button19;
private System.Windows.Forms.Button button20;
private System.Windows.Forms.Button button21;
private System.Windows.Forms.Button button22;
private System.Windows.Forms.Button button23;
[DllImport("winmm.dll", EntryPoint="PlaySound")]
public static extern bool PlaySound(ref Byte snd, IntPtr hmod, uint fdwSound);
[DllImport("winmm.dll", EntryPoint="PlaySound")]
public static extern int PlaySound(string lpszName,int hModule,int dwFlags);
public enum PlayingFlags :uint
{
SND_SYNC = 0x00,
SND_ASYNC = 0x01,
SND_NODEFAULT = 0x02,
SND_MEMORY = 0x04,
SND_ALIAS = 0x010000,
SND_FILENAME = 0x020000,
SND_RESOURCE = 0x040004,
SND_ALIAS_ID = 0x0110000,
SND_ALIAS_START = 0,
SND_LOOP = 0x08,
SND_NOSTOP = 0x010,
SND_VALID = 0x01F,
SND_NOWAIT = 0x02000,
SND_PURGE = 0x40
}
...................................................省略
private void button1_Click(object sender, System.EventArgs e)
{
Form1.PlaySound(filename.wav,0,(int)Form1.PlayingFlags.SND_SYNC);
Button btn=(Button) sender;
if (gl)
{
textBox1.Text=btn.Text;
gl=false;
}
else if (textBox1.Text=="0")
{
textBox1.Text=btn.Text;
gl=false;
}
else
{
textBox1.Text=textBox1.Text+btn.Text;
gl=false;
}
shu = Convert.ToDouble(textBox1.Text);
}
ivsee
2003-08-29
打赏
举报
回复
看看这个了
using System;
using System.Runtime.InteropServices;
class musicplay{
[DllImport("winmm.dll")]
private static extern long mciSendString(string lpstrCommand,string lpstrReturnString,long length,long hwndcallback);
public musicplay(string name){
filename=name;
}
public void play(){
t=mciSendString(@"open " + filename,m,0,0);
t=mciSendString(@"play " + filename + @" wait",m,0,0);
t=mciSendString(@"close " + filename,m,0,0);
}
private string filename;
private string m=@" ";
private long t;
}
class test{
static void Main(){
Console.WriteLine("请输入你要播放的歌曲的路径");
musicplay mpl=new musicplay(Console.ReadLine());
mpl.play();
Console.WriteLine("播放完毕,再见");
}
}
速马
2003-08-29
打赏
举报
回复
好像可以用WMP的SDK
BeyondLove2000
2003-08-29
打赏
举报
回复
directX9.0
Cango
2003-08-29
打赏
举报
回复
有人会的吗?
janus1999
2003-08-29
打赏
举报
回复
up
15种测试视频文件和13种测试
音频文件
文件包含常见的15种视频文件(
avi
/mp4/flv/wmv/vob/rmvb...)和13种
音频文件
(
mp3
/mp2/ogg/wav/m4a...)。长度大概在10秒左右,用于常规测试,欢迎大家下载
超级转换秀11.8印心豪华破解版(8.5M)
视频转换还支持不同视频文件和
音频文件
的混合合成转换,切割转换、合并转换等。允许为各导出格式选择屏幕缩放方法,并支持批量转换处理,甚至还可以允许您在最终视频的具体位置叠加自己半透明的个性文字、图片(水印...
Bootstrap入门视频课程
Bootstrap是美国Twitter公司的设计师Mark Otto和Jacob Thornton合作基于HTML、CSS、JavaScript 开发的简洁、直观、强悍的前端开发框架... 总共76集 格式:
avi
文件总大小:2.96GB 视频总时长:10小时21分 。
C/C++编程
MP3
等
音频文件
播放
程序还可以
播放
MIDI,
AVI
,WMV,MPG等影音文件 */ /* 常用的控制函数(实际上是宏): MCIWndHome(hWnd) 至起始位置 MCIWndPause(hWnd) 暂停 MCIWndPlay(hWnd) 开始
播放
MCIWndPlayFrom(hWnd,lPos) 从lPos
播放
...
C#/WPF
播放
音频文件
C#/WPF
播放
音频文件
,以及使用音频和字幕同时
播放
C#
110,536
社区成员
642,578
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章