-
Notifications
You must be signed in to change notification settings - Fork 1
/
WaveIn.h
33 lines (33 loc) · 846 Bytes
/
WaveIn.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
#pragma once
#include <mmsystem.h>
#define MAX_INPUT_BUFFERS 3
#include "WriterQ.h"
/*
This class is a simple wave in device which
captures sound data from input microphones.
*/
class CWaveIn
{
public:
CWaveIn (void);
~CWaveIn (void);
int GetDeviceCount (void);
int GetDeviceCaps (int deviceNo,PWAVEINCAPS pWaveParams);
int OpenDevice ( WORD deviceNo,
DWORD samplesPerSecond,
WORD nChannels,
WORD wBitsPerSample
);
int StartCapture (float ratio);
int StopCapture (void);
int ProcessHeader (WAVEHDR * pHdr);
CWriterQ* pWriterQ;
private:
WAVEFORMATEX m_stWFEX ;
HWAVEIN m_hWaveIn ;
WAVEHDR m_stWHDR[MAX_INPUT_BUFFERS] ;
int PrepareBuffers(float) ;
int UnPrepareBuffers(void) ;
uint32 write_size ;
int wBytesPerSample ;
};