///////////////////////////////////////////////////////
| 322 | |
| 323 | //////////////////////////////////////////////////////////// |
| 324 | void SoundRecorder::stop() |
| 325 | { |
| 326 | // Stop the capturing device if one is started |
| 327 | if (m_impl->captureDevice && ma_device_is_started(&*m_impl->captureDevice)) |
| 328 | { |
| 329 | // Stop the capture |
| 330 | if (const auto result = ma_device_stop(&*m_impl->captureDevice); result != MA_SUCCESS) |
| 331 | { |
| 332 | err() << "Failed to stop audio capture device: " << ma_result_description(result) << std::endl; |
| 333 | return; |
| 334 | } |
| 335 | |
| 336 | // Notify derived class |
| 337 | onStop(); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | |
| 342 | //////////////////////////////////////////////////////////// |