Move capture level computation after all processing.
BUG=issue1065 Review URL: https://webrtc-codereview.appspot.com/930014 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3057 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
7096fc0126
commit
c862f49b2d
@ -351,7 +351,6 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
CheckForSendCodecChanges();
|
CheckForSendCodecChanges();
|
||||||
|
|
||||||
// --- Resample input audio and create/store the initial audio frame
|
// --- Resample input audio and create/store the initial audio frame
|
||||||
|
|
||||||
if (GenerateAudioFrame(static_cast<const WebRtc_Word16*>(audioSamples),
|
if (GenerateAudioFrame(static_cast<const WebRtc_Word16*>(audioSamples),
|
||||||
nSamples,
|
nSamples,
|
||||||
nChannels,
|
nChannels,
|
||||||
@ -372,7 +371,6 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Near-end Voice Quality Enhancement (APM) processing
|
// --- Near-end Voice Quality Enhancement (APM) processing
|
||||||
|
|
||||||
APMProcessStream(totalDelayMS, clockDrift, currentMicLevel);
|
APMProcessStream(totalDelayMS, clockDrift, currentMicLevel);
|
||||||
|
|
||||||
if (swap_stereo_channels_ && stereo_codec_)
|
if (swap_stereo_channels_ && stereo_codec_)
|
||||||
@ -380,13 +378,11 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
AudioFrameOperations::SwapStereoChannels(&_audioFrame);
|
AudioFrameOperations::SwapStereoChannels(&_audioFrame);
|
||||||
|
|
||||||
// --- Annoying typing detection (utilizes the APM/VAD decision)
|
// --- Annoying typing detection (utilizes the APM/VAD decision)
|
||||||
|
|
||||||
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
#ifdef WEBRTC_VOICE_ENGINE_TYPING_DETECTION
|
||||||
TypingDetection();
|
TypingDetection();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// --- Mute during DTMF tone if direct feedback is enabled
|
// --- Mute during DTMF tone if direct feedback is enabled
|
||||||
|
|
||||||
if (_remainingMuteMicTimeMs > 0)
|
if (_remainingMuteMicTimeMs > 0)
|
||||||
{
|
{
|
||||||
AudioFrameOperations::Mute(_audioFrame);
|
AudioFrameOperations::Mute(_audioFrame);
|
||||||
@ -398,25 +394,18 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Mute signal
|
// --- Mute signal
|
||||||
|
|
||||||
if (_mute)
|
if (_mute)
|
||||||
{
|
{
|
||||||
AudioFrameOperations::Mute(_audioFrame);
|
AudioFrameOperations::Mute(_audioFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Measure audio level of speech after APM processing
|
|
||||||
|
|
||||||
_audioLevel.ComputeLevel(_audioFrame);
|
|
||||||
|
|
||||||
// --- Mix with file (does not affect the mixing frequency)
|
// --- Mix with file (does not affect the mixing frequency)
|
||||||
|
|
||||||
if (_filePlaying)
|
if (_filePlaying)
|
||||||
{
|
{
|
||||||
MixOrReplaceAudioWithFile(_mixingFrequency);
|
MixOrReplaceAudioWithFile(_mixingFrequency);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Record to file
|
// --- Record to file
|
||||||
|
|
||||||
if (_fileRecording)
|
if (_fileRecording)
|
||||||
{
|
{
|
||||||
RecordAudioToFile(_mixingFrequency);
|
RecordAudioToFile(_mixingFrequency);
|
||||||
@ -433,6 +422,8 @@ TransmitMixer::PrepareDemux(const void* audioSamples,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Measure audio level of speech after all processing.
|
||||||
|
_audioLevel.ComputeLevel(_audioFrame);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user