◆ 무한한 가능성/& Visual C/C++

waveIn~()

치로로 2010. 3. 16. 12:01

* waveIn~ 함수들에 관한 정리
 : waveIn~ 함수를 전부 정리한 것은 아니고, 사용하는 것만 정리.


ref.> waveIn은 Queue를 사용함



1.
UINT     WINAPI waveInGetNumDevs(void);
This function retrieves the number of waveform input devices present in the system.
시스템 안의 현재 음성 녹음 장치의 수를 구하는 함수
R.V.> The number of devices indicates success. Zero indicates that no devices are present or that an error occurred.


2.
MMRESULT WINAPI waveInOpen(LPHWAVEIN phwi, UINT uDeviceID,
            LPCWAVEFORMATEX pwfx, DWORD dwCallback, DWORD dwInstance, DWORD fdwOpen);
 : This function opens a specified waveform input device for recording.
 : 녹음을 위한 명기된 음성입력장치를 여는 함수


3.
MMRESULT WINAPI waveInStart(HWAVEIN hwi);
 : This function starts input on the specified waveform input device.
 : 명기된 음성입력장치에 녹음을 시작하는 함수


4.
MMRESULT WINAPI waveInPrepareHeader(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
 : This function prepares a buffer for waveform input. This function allows both the audio driver and the operating system (OS) to do time consuming processing of the header and/or buffer once at initialization. The application can use the buffer repeatedly without additional processing by the driver or the OS.
 : 녹음을 위한 버퍼를 준비하는 함수. 한번의 초기화를 해야하는 버퍼의 헤더 처리에 시간을 쓰기위해 OS와 Audio Driver에 할당하는 역할을 한다. 그러면 Application은 OS나 Drive의 추가적인 처리 없이 계속 버퍼를 쓸 수 있다.


5.
MMRESULT WINAPI waveInAddBuffer(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
 : This function sends an input buffer to the specified waveform-audio input device. When the buffer is filled, the application is notified.
 : 명기된 음성입력장치로 입력버퍼를 보내는 함수. 버퍼가 꽉 차면, Application 에 알려준다.


6.
MMRESULT WINAPI waveInUnprepareHeader(HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
 : This function cleans up the preparation performed by waveInPrepareHeader. The function must be called after the device driver fills a data buffer and returns it to the application. You must call this function before freeing the data buffer.
 : waveInPrepareHeader()함수로 운용되었던 준비작업을 초기화 해주는 함수. 이 함수는 음성장치 Drive가 데이터를 다 읽고 Application으로 리턴을 해준 후에 함수가 호출되어져야 한다. 그리고 데이터 버퍼를 비우기 전에 이 함수를 호출해야 한다.


7.
MMRESULT WINAPI waveInReset(HWAVEIN hwi);
 : This function stops input on a specified waveform input device and resets the current position to 0. All pending buffers are marked as done and returned to the application.
 : 현재위치에서 '0'으로 초기화하고 명기된 음성입력장치에 녹음하는 것을 멈추는 함수. 이 Device에 관련된 모든 버퍼는 Application으로 리턴되어지고, 작업수행을 마치게 된다.


8.
MMRESULT WINAPI waveInClose(HWAVEIN hwi);
 : This function closes the specified waveform-audio input device.
 : 명기된 음성입력 장치를 닫는 함수