Handle 96 kHz when downmixing the capture path.
BUG=issue721 TEST=96 kHz capture on Windows works. Review URL: https://webrtc-codereview.appspot.com/722004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2558 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
c0348fb349
commit
07ebdb9432
@ -28,7 +28,9 @@ namespace webrtc {
|
||||
namespace voe {
|
||||
|
||||
// Used for downmixing before resampling.
|
||||
static const int kMaxMonoDeviceDataSizeSamples = 480; // 10 ms, 48 kHz, mono.
|
||||
// TODO(andrew): audio_device should advertise the maximum sample rate it can
|
||||
// provide.
|
||||
static const int kMaxMonoDeviceDataSizeSamples = 960; // 10 ms, 96 kHz, mono.
|
||||
|
||||
void
|
||||
TransmitMixer::OnPeriodicProcess()
|
||||
@ -1149,7 +1151,7 @@ bool TransmitMixer::IsRecordingMic()
|
||||
return _fileRecording;
|
||||
}
|
||||
|
||||
|
||||
// TODO(andrew): use RemixAndResample for this.
|
||||
int TransmitMixer::GenerateAudioFrame(const int16_t audio[],
|
||||
int samples_per_channel,
|
||||
int num_channels,
|
||||
@ -1157,6 +1159,7 @@ int TransmitMixer::GenerateAudioFrame(const int16_t audio[],
|
||||
{
|
||||
const int16_t* audio_ptr = audio;
|
||||
int16_t mono_audio[kMaxMonoDeviceDataSizeSamples];
|
||||
assert(samples_per_channel <= kMaxMonoDeviceDataSizeSamples);
|
||||
// If no stereo codecs are in use, we downmix a stereo stream from the
|
||||
// device early in the chain, before resampling.
|
||||
if (num_channels == 2 && !stereo_codec_) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user