News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Wav file resource inside an executable?

Started by alloy, May 27, 2015, 01:43:42 AM

Previous topic - Next topic

alloy

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?

dedndave

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

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

alloy

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.