diff options
Diffstat (limited to 'src/audio/manager.cpp')
-rw-r--r-- | src/audio/manager.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/audio/manager.cpp b/src/audio/manager.cpp index 0461ee8..21c522e 100644 --- a/src/audio/manager.cpp +++ b/src/audio/manager.cpp @@ -98,13 +98,6 @@ AudioManager::AudioManager() { return; } - if (ma_device_start(&m_capture_device) != MA_SUCCESS) { - puts("failed to start capture"); - ma_device_uninit(&m_capture_device); - m_ok = false; - return; - } - char device_name[MA_MAX_DEVICE_NAME_LENGTH + 1]; ma_device_get_name(&m_capture_device, ma_device_type_capture, device_name, sizeof(device_name), nullptr); printf("using %s for capture\n", device_name); @@ -168,6 +161,18 @@ void AudioManager::FeedMeOpus(uint32_t ssrc, const std::vector<uint8_t> &data) { } } +void AudioManager::StartCaptureDevice() { + if (ma_device_start(&m_capture_device) != MA_SUCCESS) { + puts("failed to start capture"); + } +} + +void AudioManager::StopCaptureDevice() { + if (ma_device_stop(&m_capture_device) != MA_SUCCESS) { + puts("failed to stop capture"); + } +} + void AudioManager::SetCapture(bool capture) { m_should_capture = capture; } |