开发者

C++ Put wav file into dll

I wa开发者_如何学Gont to include one wav file into dll and play it later. How to do it? I know how to play file that is in the same direcory. But I want to include around 50 wav files into my dll.


You embed such files as resources.

You need a resource file, and e.g.

MY_WAV WAVE "file.wav"

Then to play it directly, use PlaySound.

PlaySound("MY_WAV", hInstance, SND_RESOURCE);

hInstance should be the handle passed to your DllMain


i would recommend using Bass http://www.un4seen.com/ and mp3 instead of wav

if you want to include it in your dll (load the bass.dll from memory) i can tell you how to do that (just not here)

to include wav/mp3 files in your PE (be it exe/dll) use resources

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜