-
Notifications
You must be signed in to change notification settings - Fork 3
/
WaveOut.h
46 lines (41 loc) · 959 Bytes
/
WaveOut.h
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
45
46
#pragma once
#include <windows.h>
#include <mmsystem.h>
#include "ReaderQ.h"
#include "speex/speex_preprocess.h"
#include "speex/speex_echo.h"
#define MAX_OUTPUT_BUFFERS 2
class CWaveOut
{
public:
CWaveOut(void);
public:
~CWaveOut(void);
public:
int GetDeviceCount(void);
public:
int GetDeviceCaps(int deviceNo,PWAVEOUTCAPS pWaveParams);
int ProcessHeader(WAVEHDR * pHdr);
int StartPlay(float);
int StopPlay(void);
CReaderQ* pReaderQ;
public:
int OpenDevice ( WORD deviceNo,
DWORD samplesPerSecond,
WORD nChannels,
WORD wBitsPerSample
);
private:
WAVEFORMATEX m_stWFEX ;
HWAVEOUT m_hWaveOut ;
WAVEHDR m_stWHDR[MAX_OUTPUT_BUFFERS] ;
int PrepareBuffers(float) ;
int UnprepareBuffers(void) ;
uint32 read_size ;
int wBytesPerSample ;
uint8* buffer ;
SpeexPreprocessState *st ;
SpeexEchoState *echo_state ;
short* echo_buffer ;
short* input_buffer ;
};