1
我从gamedev得到了下面的例子,我想知道如何去编译它。我已经下载了FMOD并安装在C:\Program Files\FMOD SoundSystem\FMOD Programmers API Win32
。我在我的工作目录中有.dll和一个mp3文件,但我不确定怎样编译并通过命令行链接它。用mingw编译FMOD?
编辑:代码
#include
#include "inc/fmod.h"
FSOUND_SAMPLE* handle;
int main()
{
// init FMOD sound system
FSOUND_Init (44100, 32, 0);
// load and play sample
handle=FSOUND_Sample_Load (0,"sample.mp3",0, 0, 0);
FSOUND_PlaySound (0,handle);
// wait until the users hits a key to end the app
while (!_kbhit())
{
}
// clean up
FSOUND_Sample_Free (handle);
FSOUND_Close();
}