/
play.cpp
executable file
·44 lines (39 loc) · 1.53 KB
/
play.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//--------------------------------------------------------------------------------------
// File: XAudio2BasicSound.cpp
//
// XNA Developer Connection
// (C) Copyright Microsoft Corp. All rights reserved.
//--------------------------------------------------------------------------------------
#define _WIN32_DCOM
#define _CRT_SECURE_NO_DEPRECATE
//#include <windows.h>
//#include <xaudio2.h>
//#include <strsafe.h>
//#include <shellapi.h>
//#include <mmsystem.h>
//#include <conio.h>
#include "audio.h"
/*
//--------------------------------------------------------------------------------------
// Helper macros
//--------------------------------------------------------------------------------------
#ifndef SAFE_DELETE_ARRAY
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
#endif
#ifndef SAFE_RELEASE
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
#endif
*/
//--------------------------------------------------------------------------------------
// Entry point to the program
//--------------------------------------------------------------------------------------
int main()
{
CAudio* m_pAudioBg = new CAudio();
if (m_pAudioBg->InitialiseAudio()) //Setup OGG playback
m_pAudioBg->LoadSound("base.ogg"); //Sound to play - directory location hard coded into sound class
m_pAudioBg->Play(false);
// Call Update() from your main loop...
while(m_pAudioBg->IsPlaying()) //IsPlaying() doesn't seem to work...
m_pAudioBg->Update();
}