From c92781737ccb1c9d205d872b77688e3bbf732b8e Mon Sep 17 00:00:00 2001 From: "henrike@webrtc.org" Date: Thu, 15 Aug 2013 14:13:13 +0000 Subject: [PATCH] OpenSl bug: not matching playout and record sample rate led to high or low pitch audio (depending on if playout rate was higher or lower than record rate). BUG=N/A R=fischman@webrtc.org, niklas.enbom@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2031004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4549 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_device/android/OWNERS | 3 ++- .../audio_device/android/audio_device_opensles_android.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/audio_device/android/OWNERS b/webrtc/modules/audio_device/android/OWNERS index 6ba5af0b8..e6f452e0a 100644 --- a/webrtc/modules/audio_device/android/OWNERS +++ b/webrtc/modules/audio_device/android/OWNERS @@ -1 +1,2 @@ -leozwang@webrtc.org +henrike@webrtc.org +fischman@webrtc.org \ No newline at end of file diff --git a/webrtc/modules/audio_device/android/audio_device_opensles_android.cc b/webrtc/modules/audio_device/android/audio_device_opensles_android.cc index 77479bdee..a30629464 100644 --- a/webrtc/modules/audio_device/android/audio_device_opensles_android.cc +++ b/webrtc/modules/audio_device/android/audio_device_opensles_android.cc @@ -826,10 +826,10 @@ int32_t AudioDeviceAndroidOpenSLES::InitRecording() { // Setup the format of the content in the buffer queue record_pcm_.formatType = SL_DATAFORMAT_PCM; record_pcm_.numChannels = N_REC_CHANNELS; - if (speaker_sampling_rate_ == 44000) { + if (mic_sampling_rate_ == 44000) { record_pcm_.samplesPerSec = 44100 * 1000; } else { - record_pcm_.samplesPerSec = speaker_sampling_rate_ * 1000; + record_pcm_.samplesPerSec = mic_sampling_rate_ * 1000; } record_pcm_.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16; record_pcm_.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16;