summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorAimee Linden <aimee@lindenlab.com>2010-05-22 18:09:56 +0100
committerAimee Linden <aimee@lindenlab.com>2010-05-22 18:09:56 +0100
commit32826f31ebfe19f57a1d8cc7c2f3e81df9b5de74 (patch)
treecba5f47c0073a978ab0848c9a3fda04569ee4b12 /indra/newview/llvoicevivox.cpp
parent5cf632aacbae683676c341a7f1470108cdf65b59 (diff)
EXT-7337 WIP Voice Morphing - Limit maximum recording sample to 15 seconds.
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index a64c05a3c6..f1c8ce21d2 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -96,6 +96,9 @@ const int MAX_LOGIN_RETRIES = 12;
// blocked is VERY rare and it's better to sacrifice response time in this situation for the sake of stability.
const int MAX_NORMAL_JOINING_SPATIAL_NUM = 50;
+// Maximum length of capture buffer recordings
+const F32 CAPTURE_BUFFER_MAX_TIME = 15.f;
+
static int scale_mic_volume(float volume)
{
@@ -1154,12 +1157,15 @@ void LLVivoxVoiceClient::stateMachine()
case stateCaptureBufferRecStart:
captureBufferRecordStartSendMessage();
mCaptureBufferRecorded = true;
+ mCaptureTimer.start();
+ mCaptureTimer.setTimerExpirySec(CAPTURE_BUFFER_MAX_TIME);
setState(stateCaptureBufferRecording);
break;
//MARK: stateCaptureBufferRecording
case stateCaptureBufferRecording:
- if (!mCaptureBufferMode || !mCaptureBufferRecording || mCaptureBufferPlaying)
+ if (!mCaptureBufferMode || !mCaptureBufferRecording ||
+ mCaptureBufferPlaying || mCaptureTimer.hasExpired())
{
mCaptureBufferRecording = false;
captureBufferRecordStopSendMessage();