embedding sound in executable in C++

2019-07-04 02:52发布

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?

标签: c++ audio wav
1条回答
走好不送
2楼-- · 2019-07-04 03:53

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

查看更多
登录 后发表回答