Bug 1247574: Force webrtc audio input processing to resample to target rate to fix 16KHz mics. r=padenot

MozReview-Commit-ID: BBZcX03Z6Kn
This commit is contained in:
Randell Jesup 2016-03-19 16:05:13 -04:00
Родитель 20b96bf233
Коммит 6f22cfc9fb
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -2236,7 +2236,7 @@ int32_t AudioDeviceWindowsCore::InitPlayout()
Wfx.wBitsPerSample = 16;
Wfx.cbSize = 0;
const int freqs[] = {48000, 44100, 16000, 96000, 32000, 8000};
const int freqs[] = {48000, 44100, 32000, 96000, 16000, 8000};
hr = S_FALSE;
// Iterate over frequencies and channels, in order of priority
@ -2573,7 +2573,7 @@ int32_t AudioDeviceWindowsCore::InitRecording()
Wfx.wBitsPerSample = 16;
Wfx.cbSize = 0;
const int freqs[6] = {48000, 44100, 16000, 96000, 32000, 8000};
const int freqs[6] = {48000, 44100, 32000, 96000, 16000, 8000};
hr = S_FALSE;
// Iterate over frequencies and channels, in order of priority

Просмотреть файл

@ -86,7 +86,11 @@ void DownConvertToCodecFormat(const int16_t* src_data,
// Never upsample the capture signal here. This should be done at the
// end of the send chain.
int destination_rate = std::min(codec_rate_hz, sample_rate_hz);
// XXX bug 1247574 temporary hack until we switch to full-duplex
// We need to know the final audio rate before starting the audio channels,
// and this means we can get called back in Process() with the input
// rate if it's less than the codec rate.
int destination_rate = codec_rate_hz;
// If no stereo codecs are in use, we downmix a stereo stream from the
// device early in the chain, before resampling.