8 ////////////////////////////////////////////////////////////////////////////////
9 //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
10 ////////////////////////////////////////////////////////////////////////////////
11 CWaveData::CWaveData()
13 // Wave
\83t
\83H
\81[
\83}
\83b
\83g
14 m_WaveFormat.wFormatTag = WAVE_FORMAT_PCM;
15 m_WaveFormat.nChannels = 1;
16 m_WaveFormat.nSamplesPerSec = 22050;
17 m_WaveFormat.wBitsPerSample = 8;
18 m_WaveFormat.nBlockAlign = m_WaveFormat.wBitsPerSample / 8 * m_WaveFormat.nChannels;
19 m_WaveFormat.nAvgBytesPerSec = m_WaveFormat.nSamplesPerSec * m_WaveFormat.nBlockAlign;
22 ////////////////////////////////////////////////////////////////////////////////
23 //
\83f
\83X
\83g
\83\89\83N
\83^
24 ////////////////////////////////////////////////////////////////////////////////
25 CWaveData::~CWaveData()
30 ////////////////////////////////////////////////////////////////////////////////
32 ////////////////////////////////////////////////////////////////////////////////
33 void CWaveData::initialize()
35 //
\8c»
\8fó
\83t
\83H
\81[
\83}
\83b
\83g
\82Í
\8c\88\82ß
\82¤
\82¿
36 m_WaveFormat.wFormatTag = WAVE_FORMAT_PCM;
37 m_WaveFormat.nChannels = 1;
38 m_WaveFormat.nSamplesPerSec = 22050;
39 m_WaveFormat.wBitsPerSample = 8;
40 m_WaveFormat.nBlockAlign = m_WaveFormat.wBitsPerSample / 8 * m_WaveFormat.nChannels;
41 m_WaveFormat.nAvgBytesPerSec = m_WaveFormat.nSamplesPerSec * m_WaveFormat.nBlockAlign;
44 ////////////////////////////////////////////////////////////////////////////////
45 //
\83o
\83b
\83t
\83@
\82ð
\8am
\95Û
46 ////////////////////////////////////////////////////////////////////////////////
47 bool CWaveData::allocBuffer(int in_BufferNumber, DWORD in_RecorMilliSecond)
49 if(in_BufferNumber < 1 || in_RecorMilliSecond == 0){
53 if(m_WaveBuffers.empty()){
60 for(int i = 0; i < in_BufferNumber; i++){
61 StructWaveBuffer tempWaveBuffer;
62 tempWaveBuffer.m_RecorMilliSecond = in_RecorMilliSecond;
63 tempWaveBuffer.m_BufferSize = m_WaveFormat.nAvgBytesPerSec * in_RecorMilliSecond / 1000;
64 tempWaveBuffer.m_pWaveBuffer = new char[tempWaveBuffer.m_BufferSize];
66 m_WaveBuffers.push_back(tempWaveBuffer);
69 //
\93Ç
\82Ý
\8eæ
\82è
\83o
\83b
\83t
\83@
\82Æ
\8f\91\82«
\8d\9e\82Ý
\83o
\83b
\83t
\83@
\82ð
\8ew
\92è
\82µ
\82Ä
\82¨
\82
70 m_ReadOfWaveBuffers = m_WaveBuffers.begin();
71 m_WriteOfWaveBuffers = m_WaveBuffers.begin();
76 ////////////////////////////////////////////////////////////////////////////////
77 //
\83o
\83b
\83t
\83@
\82ð
\89ð
\95ú
78 ////////////////////////////////////////////////////////////////////////////////
79 bool CWaveData::freeBuffer()
81 if(!m_WaveBuffers.empty()){
82 WaveBufferTable::iterator tempIterator = m_WaveBuffers.begin();
83 while(tempIterator != m_WaveBuffers.end()){
84 delete tempIterator->m_pWaveBuffer;