summaryrefslogtreecommitdiffstats
path: root/content/browser/speech/speech_recognizer.cc
diff options
context:
space:
mode:
authorannacc@chromium.org <annacc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 22:18:32 +0000
committerannacc@chromium.org <annacc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 22:18:32 +0000
commitb630cb97c620593f9c987fdad0b3271ddbf39a3e (patch)
tree21295811329d31b302e29be7e16198fdfd5bc463 /content/browser/speech/speech_recognizer.cc
parent99d22e8b1c2c0b6f6457147ab90ce2df98ef02d3 (diff)
downloadchromium_src-b630cb97c620593f9c987fdad0b3271ddbf39a3e.zip
chromium_src-b630cb97c620593f9c987fdad0b3271ddbf39a3e.tar.gz
chromium_src-b630cb97c620593f9c987fdad0b3271ddbf39a3e.tar.bz2
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
Diffstat (limited to 'content/browser/speech/speech_recognizer.cc')
-rw-r--r--content/browser/speech/speech_recognizer.cc4
1 files changed, 2 insertions, 2 deletions
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);