推荐一个简单的声音引擎
绝对轻量级的声音引擎,audiere,支持跨平台,可以去http://sourceforge.net/projects/audiere/下载,再给个小例子,^_^
用VC6或者其他配置好工程,建个控制台程序即可
#include <iostream>
using namespace std;
#include "audiere.h"
audiere::AudioDevicePtr device(audiere::OpenDevice());
audiere::OutputStreamPtr stream(audiere::OpenSound(device, "music.wav", false));
int main()
{
stream->setRepeat(true);
stream->setVolume(0.5f); // 50% volume
stream->play();
int a;
cin >> a;
return 0;
}
using namespace std;
#include "audiere.h"
audiere::AudioDevicePtr device(audiere::OpenDevice());
audiere::OutputStreamPtr stream(audiere::OpenSound(device, "music.wav", false));
int main()
{
stream->setRepeat(true);
stream->setVolume(0.5f); // 50% volume
stream->play();
int a;
cin >> a;
return 0;
}