Gab*_*ona 24
使用FMOD(跨平台),这应该是这样简单:
#include <conio.h>
#include "inc/fmod.h"
FSOUND_SAMPLE* handle;
int main ()
{
// init FMOD sound system
FSOUND_Init (44100, 32, 0);
// load and play mp3
handle=FSOUND_Sample_Load (0,"my.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();
}
Run Code Online (Sandbox Code Playgroud)
作为旁注,我建议你使用C++而不是C.
| 归档时间: |
|
| 查看次数: |
90301 次 |
| 最近记录: |