我开发的一个游戏中,采用背景音乐,但为了简洁起见,不想用文件,想将一个midi文件导成资源如IDR_MYMIDIMUSIC,然后用mciSendString播放。(不能用playsound播放,因为这是一个单独的线程,且另还有音效,是用playsound播放的)。欢迎给个实例。

解决方案 »

  1.   

    to hrh2001(边城浪子):这位好心的大哥,可不可以写点代码给偶瞧瞧,怎么把资源保存为临时文件。
      

  2.   


    http://www.windevnet.com/documents/s=7295/wdj9810b/9810b.htmPlaying MIDI Resources
    Davide Ficano--------------------------------------------------------------------------------MIDI files provide a compact alternative to waveform files for producing tones or music; they encode voice, tone, and duration rather than a detailed waveform. Windows provides a variety of functions for playing sound files of both types. At the highest level, you can pass a plain English command to mciSendString() to play a sound file, allowing Windows to handle all the work. At a lower level, you can use multimedia functions to start and control the playback of a MIDI or waveform file.