Playing a wave sound from a resource file
来源:互联网 发布:linux samba 自启动 编辑:程序博客网 时间:2024/06/09 20:42
In article <01bbde3a$960b1a00$1500dece@dbrown.ee.net>, dbrown@ee.net says...I am attempting to have a wave file play when a button is clicked, in myDelphi application. Rather than install the wave file and use thePlaySound() API call, I'd like to put it into a resource file so that itplays with only the EXE present.
you need a resource compiler (i. E. Resource Workshop ) and add an user-defined-resource WAVE. You can play the resource-file in your program using
var FindHandle, ResHandle: THandle; ResPtr: Pointer; begin; FindHandle:=FindResource(HInstance, '<Name of your Ressource>', 'WAVE'); if FindHandle<>0 then begin ResHandle:=LoadResource(HInstance, FindHandle); if ResHandle<>0 then begin ResPtr:=LockResource(ResHandle); if ResPtr<>Nil then SndPlaySound(PChar(ResPtr), snd_ASync or snd_Memory); UnlockResource(ResHandle); end; FreeResource(FindHandle);
- Playing a wave sound from a resource file
- Playing a sound with AVAudioPlayer播放本地文件
- Changing speed of a sound file
- Java ME, take a snapshot from a playing video
- how-to-load-resource-from-jar-file-packaged-in-a-war-file
- Ionic – Playing a media file with ngCordova’s $cordovaMedia
- A. Playing with Dice
- A. Playing with Paper
- A. Playing with Paper
- A-Playing with Paper
- A-Playing with Paper
- Sample Post From a File
- Read a file from xml
- Sample Post From a File
- Reading records from a file
- Download a file from a FTP Server
- Grab a picture from a FLV file
- Read file from inside a JAR file
- 关于Cookie跨域的问题
- Delphi 声卡录制
- 如何拷贝CMD DOS 窗口中的内容
- 百度谷歌搜索引擎高级指令
- MVC模式已死?何不试试MOVE
- Playing a wave sound from a resource file
- VB.NET时间日期数据处理及技巧
- Android引路蜂地图开发示例:选择地图服务
- Wave File format help
- IT工程师需谨记的15条箴言
- 各个版本SQL Server联机丛书下载地址
- Java集合HashSet-ArrayList-HashMap的线程同步控制方法和区别
- 我的第一个头文件(2012.07.06)
- D2: Win95 + Speaker + Sound := possible