diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-07-15 13:44:09 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-07-16 20:05:23 +0300 | 
| commit | be0417557959ad92951a6705b357cbd66427d24a (patch) | |
| tree | 6df60c81194750b312672e34957098455d0fb5e0 /indra/newview | |
| parent | f97ae3c151f252d4559ac627a51b1ebf9d434b08 (diff) | |
#4358 Fix 'Microphone in use' task bar icon
1. set_enabled(false) failed to apply, force set it to trigger observers
and remove the icon
2. Don't set audio devices if voice was disabled
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 42 | 
1 files changed, 22 insertions, 20 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 9835a69e4e..627d759df4 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -336,35 +336,37 @@ void LLWebRTCVoiceClient::updateSettings()      LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;      setVoiceEnabled(LLVoiceClient::getInstance()->voiceEnabled()); -    static LLCachedControl<S32> sVoiceEarLocation(gSavedSettings, "VoiceEarLocation"); -    setEarLocation(sVoiceEarLocation); - -    static LLCachedControl<std::string> sInputDevice(gSavedSettings, "VoiceInputAudioDevice"); -    setCaptureDevice(sInputDevice); +    if (mVoiceEnabled) +    { +        static LLCachedControl<S32> sVoiceEarLocation(gSavedSettings, "VoiceEarLocation"); +        setEarLocation(sVoiceEarLocation); -    static LLCachedControl<std::string> sOutputDevice(gSavedSettings, "VoiceOutputAudioDevice"); -    setRenderDevice(sOutputDevice); +        static LLCachedControl<std::string> sInputDevice(gSavedSettings, "VoiceInputAudioDevice"); +        setCaptureDevice(sInputDevice); -    LL_INFOS("Voice") << "Input device: " << std::quoted(sInputDevice()) << ", output device: " << std::quoted(sOutputDevice()) << LL_ENDL; +        static LLCachedControl<std::string> sOutputDevice(gSavedSettings, "VoiceOutputAudioDevice"); +        setRenderDevice(sOutputDevice); -    static LLCachedControl<F32> sMicLevel(gSavedSettings, "AudioLevelMic"); -    setMicGain(sMicLevel); +        LL_INFOS("Voice") << "Input device: " << std::quoted(sInputDevice()) << ", output device: " << std::quoted(sOutputDevice()) << LL_ENDL; -    llwebrtc::LLWebRTCDeviceInterface::AudioConfig config; +        static LLCachedControl<F32> sMicLevel(gSavedSettings, "AudioLevelMic"); +        setMicGain(sMicLevel); -    static LLCachedControl<bool> sEchoCancellation(gSavedSettings, "VoiceEchoCancellation", true); -    config.mEchoCancellation = sEchoCancellation; +        llwebrtc::LLWebRTCDeviceInterface::AudioConfig config; -    static LLCachedControl<bool> sAGC(gSavedSettings, "VoiceAutomaticGainControl", true); -    config.mAGC = sAGC; +        static LLCachedControl<bool> sEchoCancellation(gSavedSettings, "VoiceEchoCancellation", true); +        config.mEchoCancellation = sEchoCancellation; -    static LLCachedControl<U32> sNoiseSuppressionLevel(gSavedSettings, -                                                       "VoiceNoiseSuppressionLevel", -                                                       llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel::NOISE_SUPPRESSION_LEVEL_VERY_HIGH); -    config.mNoiseSuppressionLevel = (llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel) (U32)sNoiseSuppressionLevel; +        static LLCachedControl<bool> sAGC(gSavedSettings, "VoiceAutomaticGainControl", true); +        config.mAGC = sAGC; -    mWebRTCDeviceInterface->setAudioConfig(config); +        static LLCachedControl<U32> sNoiseSuppressionLevel(gSavedSettings, +            "VoiceNoiseSuppressionLevel", +            llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel::NOISE_SUPPRESSION_LEVEL_VERY_HIGH); +        config.mNoiseSuppressionLevel = (llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel)(U32)sNoiseSuppressionLevel; +        mWebRTCDeviceInterface->setAudioConfig(config); +    }  }  // Observers  | 
