diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 14:34:03 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 14:34:03 -0800 |
commit | 7287cfbd7ad8f61114d0176c6fc7c3218c758900 (patch) | |
tree | 4204306e6a4dad95f6e524a3c881429e0b7e0311 /indra/newview/llvoicevivox.cpp | |
parent | 70068a244b55c00a51cc48f09634a2fe4cedd54b (diff) |
For spatial voice, determine voice provider based on server setting.
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 3c01f00596..d708870314 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -85,7 +85,8 @@ namespace { const F32 SPEAKING_TIMEOUT = 1.f; - static const std::string VOICE_SERVER_TYPE = "Vivox"; + static const std::string VISIBLE_VOICE_SERVER_TYPE = "Vivox"; + static const std::string VIVOX_VOICE_SERVER_TYPE = "vivox"; // Don't retry connecting to the daemon more frequently than this: const F32 DAEMON_CONNECT_THROTTLE_SECONDS = 1.0f; @@ -358,7 +359,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mSpeakerVolume = scale_speaker_volume(0); mVoiceVersion.serverVersion = ""; - mVoiceVersion.serverType = VOICE_SERVER_TYPE; + mVoiceVersion.voiceServerType = VISIBLE_VOICE_SERVER_TYPE; // gMuteListp isn't set up at this point, so we defer this until later. // gMuteListp->addObserver(&mutelist_listener); @@ -737,6 +738,19 @@ void LLVivoxVoiceClient::voiceControlStateMachine(S32 &coro_state) return; } + + // grab the active voice server version info to see if we should use + // vivox. + LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); + if (version.voiceServerType != VISIBLE_VOICE_SERVER_TYPE) + { + // we've switched to another voice provider, so + // disable voice and shut down vivox. Don't + // notify, though. + mVoiceEnabled = false; + } + + switch (coro_state) { case VOICE_STATE_TP_WAIT: @@ -1972,6 +1986,17 @@ bool LLVivoxVoiceClient::waitForChannel() return false; } + // grab the active voice server version info to see if we should use + // vivox. + LLVoiceVersionInfo version = LLVoiceClient::getInstance()->getVersion(); + if (version.voiceServerType != VISIBLE_VOICE_SERVER_TYPE) + { + // we've switched to another voice provider, so + // disable voice and shut down vivox. Don't + // notify, though. + mVoiceEnabled = false; + } + switch (state) { case VOICE_CHANNEL_STATE_LOGIN: |