|
|
|
|
@ -48,7 +48,7 @@ RadioAudioEngine::RadioAudioEngine() {
|
|
|
|
|
auto* manager = SoundManager::instance(); |
|
|
|
|
if (m_captureId != manager->captureDevice()) { |
|
|
|
|
m_captureId = manager->captureDevice(); |
|
|
|
|
if (!m_capture.closing()) m_capture.close(); |
|
|
|
|
if (m_capture.closing()) m_capture.closeAsync(); else m_capture.close(); |
|
|
|
|
m_captureError.clear(); |
|
|
|
|
emit stateChanged(); |
|
|
|
|
} |
|
|
|
|
@ -192,7 +192,7 @@ void RadioAudioEngine::postSettings(const std::array<int, 9>& values, bool apply
|
|
|
|
|
void RadioAudioEngine::reconfigureCapture() { |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_RADIO, "RadioAudio: reconfigure capture group=%016llx manual=%d auto=%d", |
|
|
|
|
(unsigned long long)m_groupId.load(), m_talking.load(), autoEnabled()); |
|
|
|
|
if (!m_capture.closing()) m_capture.close(); |
|
|
|
|
if (m_capture.closing()) m_capture.closeAsync(); else m_capture.close(); |
|
|
|
|
m_wantStereo = chat_setting_get_int(gui_bridge_get_inst(), "radio_capture_stereo", 0) != 0; |
|
|
|
|
updateState(); |
|
|
|
|
recoverDevices(); |
|
|
|
|
@ -291,7 +291,7 @@ void RadioAudioEngine::pauseDevices() {
|
|
|
|
|
|
|
|
|
|
void RadioAudioEngine::stop() { |
|
|
|
|
m_recoveryTimer.stop(); |
|
|
|
|
if (!m_capture.closing()) m_capture.close(); |
|
|
|
|
if (m_capture.closing()) m_capture.closeAsync(); else m_capture.close(); |
|
|
|
|
SoundManager::instance()->detachVoice(&m_voice); m_outputAttached = false; |
|
|
|
|
m_voice.stop(); |
|
|
|
|
m_microphone.release(); |
|
|
|
|
|