中国程序员联盟 正在重新改版中ing 不便之处还请见谅 改版后将内容涉及java delphi .net php
 
  首页 | 数据库开发 | 网络通讯 | 多线程 | 多媒体开发 | 图像处理 | 程序人生 | 系统函数 | 控件开发 | Web服务
 
  当前位置:笨鱼delphi技术网>多媒体开发>文章内容

delphi 如何将.wav多媒体文件加载到可的执行程序

来源:国外 关于:Lou Adler 发布时间:2007-07-15   [收藏] [推荐]
STEP 1:
Create a resource script file (*.RC) with a simple text editor like Notepad and add the following line:
1 WAVE "MyWav.wav"
The '1' is simply the index of the resource.  The 'WAVE' specifies that we are dealing with a WAVE FILE user-defined resource.  The third and final entry is the name of the Wav file.
STEP 2:
User Borland's Resource Compiler, BRCC32.EXE, to compile it into a .RES file.  At the MS- DOS command line, type:
BRCC32 MyWav.RC
This will create a resource file called MyWav.RES.
STEP 3:
Add a compiler directive to the source code of your program.  It should immediately follow the form directive, as shown here:
{$R *.DFM}
{$R MyWAV.RES}
STEP 4:
Add the following code to your project:
procedure TForm1.Button1Click(Sender: TObject);
begin
  PlaySound(PChar(1), HInstance, snd_ASync or snd_Memory or snd_Resource);
end;
You can add as many .Wav files as you want, just by adding another index number to your list, and call it using the PChar(index) in the PlaySound line.
STEP 5:
Run your program and click on the button, and enjoy.
Hint:  MMSystem must be in the uses clause!

[浏览: 次]   
上一篇:delphi 分析多媒体波频文件   下一篇:delphi 如何处理wave多媒体文件的split
[收藏] [推荐] [返回顶部] [打印本页] [关闭窗口]  
    评论加载中…
google adsense热点文章
·delphi 播放wav文件
·delphi 设置声卡音量
·delphi 多媒体wave文件写盘
·delphi 多媒体音量调节
·delphi 音量输出仪表
·delphi 多媒体wave文件CD音频
·delphi 分析多媒体波频文件
·delphi 音乐播放器信号显示组件
·delphi 音乐播放器扬声器类
·delphi 如何处理wave多媒体文件的split
·delphi 如何处理扩展名为.avi的audio流
     delphi技术网 | firefox 下载 | Avant Browser下载 | dedecms 技术网 | drupal 爱好者 | php 技术网
  Copyright@www.delphichm.com,2006-2009.All Rights Reserved.
 
程序员联盟 | delphi Java .net|QQ:707102932