From: "Ralph Friedman (TeamB)" Subject: Re: Saving a .wav in my .exe Date: Thursday, January 04, 2001 4:54 AM Dan, in message <3a540b33_2@dnews> you wrote: > I'm currently using PlaySound to play a .wav file. I would like to be able > to include the wav in my program executable, but how can I do this? I've > seen a few times that external files can be saved in some sort of resource > file but where would I then point PlaySound to if the file is stored in the > exe?? Here's a couple of alternatives: procedure TFrmWaves.PlayTheSound(AName: PChar); var resInfo: THandle; wavHdl: THandle; wavPtr: Pointer; begin case RgrMethod.ItemIndex of 0: begin resInfo := FindResource(HInstance, AName, RES_TYPE); if resInfo <> 0 then begin Label1.Caption := StrPas(AName); wavHdl := LoadResource(HInstance, resInfo); wavPtr := LockResource(wavHdl); sndPlaySound(wavPtr, SND_ASYNC or SND_MEMORY); if (wavHdl <> 0) then begin UnlockResource(wavHdl); FreeResource(wavHdl); end; end else Label1.Caption := StrPas(AName) + ': Not found'; end; 1: PlaySound(AName, HInstance, SND_RESOURCE); end; end; -- Regards Ralph (TeamB) ===