From b630cb97c620593f9c987fdad0b3271ddbf39a3e Mon Sep 17 00:00:00 2001 From: "annacc@chromium.org" Date: Mon, 16 May 2011 22:18:32 +0000 Subject: Description: This patch gets the channel layout for surround sound channel order from ffmpeg and stores it so that chromium will be able to re-order the channels for various sound cards and OSes later. - AudioParameters gets a new field (channel_layout). - channel_layout.h stores an enum that we will use in chromium for channel values. - ffmpeg_common.h gets a new method for mapping the channel layout received from ffmpeg to an internal chromium enum value. BUG=None (though storing the channel order should help us solve some other bugs soon) TEST=media_unittests Review URL: http://codereview.chromium.org/6930039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85541 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/speech/speech_recognizer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content/browser/speech/speech_recognizer.cc') diff --git a/content/browser/speech/speech_recognizer.cc b/content/browser/speech/speech_recognizer.cc index 7a4ebd1..9408f46 100644 --- a/content/browser/speech/speech_recognizer.cc +++ b/content/browser/speech/speech_recognizer.cc @@ -49,7 +49,7 @@ namespace speech_input { const int SpeechRecognizer::kAudioSampleRate = 16000; const int SpeechRecognizer::kAudioPacketIntervalMs = 100; -const int SpeechRecognizer::kNumAudioChannels = 1; +const ChannelLayout SpeechRecognizer::kChannelLayout = CHANNEL_LAYOUT_MONO; const int SpeechRecognizer::kNumBitsPerAudioSample = 16; const int SpeechRecognizer::kNoSpeechTimeoutSec = 8; const int SpeechRecognizer::kEndpointerEstimationTimeMs = 300; @@ -102,7 +102,7 @@ bool SpeechRecognizer::StartRecording() { encoder_.reset(AudioEncoder::Create(codec_, kAudioSampleRate, kNumBitsPerAudioSample)); int samples_per_packet = (kAudioSampleRate * kAudioPacketIntervalMs) / 1000; - AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kNumAudioChannels, + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, kAudioSampleRate, kNumBitsPerAudioSample, samples_per_packet); audio_controller_ = AudioInputController::Create(this, params); -- cgit v1.1