summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-12-16 17:10:29 +0000
committerLynx Linden <lynx@lindenlab.com>2009-12-16 17:10:29 +0000
commit5d7cb423604554bf652487c2783b3e213966bf45 (patch)
tree6ede8da6739a07288ca3e84ded27191b463f92dc
parent3eea3281af4277e9b0201dab60f6579b6140a9d0 (diff)
EXT-3517: Update mic/speaker volume scaling.
We now scale the mic and speaker volume levels to the Vivox range 30 to 70 (default of 50), as recommended by Vivox for their V3 SDK.
-rw-r--r--indra/newview/llvoiceclient.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 1889ca78c3..cfa1f05ec0 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -113,23 +113,15 @@ static void setUUIDFromStringHash(LLUUID &uuid, const std::string &str)
static int scale_mic_volume(float volume)
{
// incoming volume has the range [0.0 ... 2.0], with 1.0 as the default.
- // Map it as follows: 0.0 -> 40, 1.0 -> 44, 2.0 -> 75
-
- volume -= 1.0f; // offset volume to the range [-1.0 ... 1.0], with 0 at the default.
- int scaled_volume = 44; // offset scaled_volume by its default level
- if(volume < 0.0f)
- scaled_volume += ((int)(volume * 4.0f)); // (44 - 40)
- else
- scaled_volume += ((int)(volume * 31.0f)); // (75 - 44)
-
- return scaled_volume;
+ // Map it to Vivox levels as follows: 0.0 -> 30, 1.0 -> 50, 2.0 -> 70
+ return 30 + (int)(volume * 20.0f);
}
static int scale_speaker_volume(float volume)
{
// incoming volume has the range [0.0 ... 1.0], with 0.5 as the default.
- // Map it as follows: 0.0 -> 0, 0.5 -> 50, 1.0 -> 100
- return (int)(volume * 100.0f);
+ // Map it to Vivox levels as follows: 0.0 -> 30, 0.5 -> 50, 1.0 -> 70
+ return 30 + (int)(volume * 40.0f);
}
class LLViewerVoiceAccountProvisionResponder :