The MASM Forum

General => The Campus => Topic started by: alloy on May 27, 2015, 01:43:42 AM

Title: Wav file resource inside an executable?
Post by: alloy on May 27, 2015, 01:43:42 AM
I've been trying to find a simple way to put a wav file into an executable to play without luck. Getting an external wav file to play has worked.


.686
.model flat,stdcall
option casemap:none
.xmm
include c:\masm32\include\windows.inc
include c:\masm32\include\kernel32.inc
includelib c:\masm32\lib\kernel32.lib
include c:\masm32\include\winmm.inc
includelib c:\masm32\lib\winmm.lib

.data
d_wav   db  "c:\windows\media\chimes.wav", 0

.code
start:
invoke PlaySound,addr d_wav,0,SND_FILENAME
invoke Sleep,500
invoke ExitProcess,eax
end start



Can anyone help me understand how to work with resources?
Title: Re: Wav file resource inside an executable?
Post by: dedndave on May 27, 2015, 02:17:54 AM
load it as a resource - that's the easiest way

this link has an attachment...

http://www.masmforum.com/board/index.php?topic=15882.msg131239#msg131239 (http://www.masmforum.com/board/index.php?topic=15882.msg131239#msg131239)

by the way, there is a help file for resources...

masm32\bin\rc.hlp

probably didn't find it, because it's not in the help folder   :P
Title: Re: Wav file resource inside an executable?
Post by: alloy on May 27, 2015, 03:56:10 AM
Thanks Dave. The files are spread around a bit. Being away for a while it took some searching to re-find Iczelion's tutorials too.