3#ifdef ENABLE_KINECT_SDK
10#include <wmcodecdsp.h>
15#pragma comment(lib, "Msdmo.lib")
16#pragma comment(lib, "amstrmid.lib")
17#pragma comment(lib, "Kinect10.lib")
20#define KINECT_AUDIO_SINGLE_AEC 0
21#define KINECT_AUDIO_ARRAY 2
22#define KINECT_AUDIO_ARRAY_AEC 4
23#define KINECT_AUDIO_SINGLE 5
32static const WORD KinectAudioFormat = WAVE_FORMAT_PCM;
33static const WORD KinectAudioChannels = 1;
34static const DWORD KinectAudioSamplesPerSec = 16000;
35static const WORD KinectAudioBitsPerSample = 16;
45 CKinectAudio(INuiSensor* sensor=NULL,
int mode=KINECT_AUDIO_SINGLE_AEC);
46 virtual ~CKinectAudio(
void);
48 BOOL init(INuiSensor* sensor,
int mode=KINECT_AUDIO_SINGLE_AEC);
50 IStream* getIStream(
void) {
return m_pStream;}
53 BOOL setProperty(
int mode);
54 BOOL setMediaType(
void);
56 BOOL startCapture(
void) {
if (m_audioStream!=NULL)
return m_audioStream->startCapture();
else return FALSE;}
57 void stopCapture(
void) {
if (m_audioStream!=NULL) m_audioStream->stopCapture(); }
59 Buffer getAudioData(
void) {
if (m_audioStream!=NULL)
return m_audioStream->input();
else return init_Buffer();}
60 void getAudioData(Buffer* pbuf);
63 BOOL openOutput(
void) {
if (m_audioStream!=NULL)
return m_audioStream->openOutput();
else return FALSE;}
64 void closeOutput(
void) {
if (m_audioStream!=NULL) m_audioStream->closeOutput();}
68 WAVEFORMATEX getAudioFormat(
void);
72 CWinAudioStream* m_audioStream;
74 INuiAudioBeam* m_audioSource;
75 IMediaObject* m_audioMedia;
76 IPropertyStore* m_audioProperty;
81 CKinectAudio& operator = (CKinectAudio& rhs) {
return rhs;}