diff options
author | primiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 23:57:51 +0000 |
---|---|---|
committer | primiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 23:57:51 +0000 |
commit | fad64e7a123b6ddd2ba8af13441c74f8f37966ee (patch) | |
tree | 28f09e77787e4a77ed30d45743086f12b62f58ee /content/browser/speech/endpointer/endpointer_unittest.cc | |
parent | 4a5aebb91b0784ef133a926773b0b9e517f288d9 (diff) | |
download | chromium_src-fad64e7a123b6ddd2ba8af13441c74f8f37966ee.zip chromium_src-fad64e7a123b6ddd2ba8af13441c74f8f37966ee.tar.gz chromium_src-fad64e7a123b6ddd2ba8af13441c74f8f37966ee.tar.bz2 |
Added AudioBuffer/AudioChunk abstractions for speech recognition and improved speech_recognizer_impl_unittest.
audio_encoder - Introduced AudioBuffer class in order to hide the current string-based implementation (which involved a lot of dirty and distributed casts) and make room for future implementations based on a circular buffer.
speech_recognizer_impl_unittest
- Created MockAudioManager class, in order to avoid using the true audio manager on trybots, which could lead to errors accessing the audio device.
BUG=116954
TEST=speech_recognizer_impl_uinittest should never raise errors related to the audio driver (e.g, device in use, no microphone attached, etc).
Review URL: http://codereview.chromium.org/9646031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126512 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/endpointer/endpointer_unittest.cc')
-rw-r--r-- | content/browser/speech/endpointer/endpointer_unittest.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/content/browser/speech/endpointer/endpointer_unittest.cc b/content/browser/speech/endpointer/endpointer_unittest.cc index 240e5dc..37f2339 100644 --- a/content/browser/speech/endpointer/endpointer_unittest.cc +++ b/content/browser/speech/endpointer/endpointer_unittest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/browser/speech/audio_buffer.h" #include "content/browser/speech/endpointer/endpointer.h" #include "testing/gtest/include/gtest/gtest.h" @@ -116,7 +117,8 @@ class EndpointerFrameProcessor : public FrameProcessor { : endpointer_(endpointer) {} EpStatus ProcessFrame(int64 time, int16* samples, int frame_size) { - endpointer_->ProcessAudio(samples, kFrameSize, NULL); + AudioChunk frame(reinterpret_cast<uint8*>(samples), kFrameSize * 2, 2); + endpointer_->ProcessAudio(frame, NULL); int64 ep_time; return endpointer_->Status(&ep_time); } |