Use wave file from project

audio, delphi, playback, static

Solution

If you use `PlaySound()` instead of `sndPlaySound()`, you can utilize the `SND_RESOURCE` flag to play the wave sound directly from its resource without having to load it into memory first.

Problem

I currently can only playback my background sound from having my wave file next to my compiled exe. But I actually want to have a single static executable with the wave file inside. Is this possible in Delphi XE2? This is my code: ``` SndPlaySound('.\Raw.wav', SND_ASYNC or SND_LOOP); #This will play the Raw.wav that is next to my program. ```

Original source