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
This commit is contained in:
henrike@webrtc.org 2013-08-15 14:13:13 +00:00
parent 4298f73031
commit c92781737c
2 changed files with 4 additions and 3 deletions

View File

@ -1 +1,2 @@
leozwang@webrtc.org
henrike@webrtc.org
fischman@webrtc.org

View File

@ -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;