embedding sound in executable in C++

半腔热情 提交于 2019-12-23 18:20:39

问题


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



来源:https://stackoverflow.com/questions/25997518/embedding-sound-in-executable-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!