void SoundRecorder::cleanup() { // Stop the capture alcCaptureStop(captureDevice); // Get the samples left in the buffer processCapturedSamples(); // Close the device alcCaptureCloseDevice(captureDevice); captureDevice = NULL; }
void SoundRecorder::record() { while (m_isCapturing) { // Process available samples processCapturedSamples(); // Don't bother the CPU while waiting for more captured data sleep(m_processingInterval); } // Capture is finished: clean up everything cleanup(); }
void SoundRecorder::record() { while (m_isCapturing) { // Process available samples processCapturedSamples(); // Don't bother the CPU while waiting for more captured data sleep(milliseconds(100)); } // Capture is finished : clean up everything cleanup(); // Notify derived class onStop(); }