自行设计的音频管理器

使用代码如下:

#include <cstdio> #include <iostream> #include "AudioType.hpp" #include "AudioPlayer.hpp" #include "Thread.hpp" #include "AudioData.hpp" #include "AudioManager.hpp" using namespace std; #pragma comment(lib,"AudioMgr.lib") int main(int argc, char *argv[]) { g::AudioManager *mgr = g::AudioManager::CreateAuidoMgr(g::AUDIO_MGR_OPENAL); mgr->Init(); mgr->GetListener()->SetPosition(2,0,0); g::AudioData *data = g::AudioData::CreateAudioData(g::AUDIO_TYPE_OGG); data->LoadAudio("Bomb.ogg"); g::AudioPlayer *player = g::AudioPlayer::CreateAudioPlayer(g::AUDIO_MGR_OPENAL, data); mgr->AddPlayer("2",player); player->SetPlayerOri(1,0,1); mgr->Play("2",false); mgr->Update(); mgr->Exit(); std::cout<<"finished audio player"<<std::endl; delete data; delete player; delete mgr; system("pause"); return 0; }

你可能感兴趣的:(delete,audio)