how can I store sound in my executable file? Let's pretend I have function x to play sound located in C:\sounds, how can I store sound.wav inside of executable? do I have to read it byte by byte and hardcode it in some variable, then create file and play it when user executes my file?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I would advice hardcoding the contents of the .wav in some variable and then play it's contents using 'sndPlaySound' with 'SND_MEMORY' option as in this example supplied by Microsoft: http://support.microsoft.com/kb/133064