summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech/endpointer/endpointer_unittest.cc
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 12:07:57 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-16 12:07:57 +0000
commitfc89d8ae5916652cce7a00f5adac4d0e812b5c16 (patch)
treed728195ba6ca3244adb47ff9e21dc971abb5f625 /chrome/browser/speech/endpointer/endpointer_unittest.cc
parentfda165787a252f0fd424f7137619f0bf0c1482dd (diff)
downloadchromium_src-fc89d8ae5916652cce7a00f5adac4d0e812b5c16.zip
chromium_src-fc89d8ae5916652cce7a00f5adac4d0e812b5c16.tar.gz
chromium_src-fc89d8ae5916652cce7a00f5adac4d0e812b5c16.tar.bz2
Show a volume indicator as audio is being recorded.
Per UX input from Cole, this matches the implementation in the android voice actions app. Changes in this CL: - Instead of the old mic icon use the recently added mic-volume-empty, mic-volume-full and mask images for the volume indicator. - Extended the endpointer code to return the audio RMS level (copied from the original source). - SpeechRecognizer receives the above calculated RMS level and computes a volume level in the [0.0-1.0] range. - SpeechInputManager receives the above computed volume level and passes it to SpeechInputBubbleController for display, which passes it to SpeechInputBubble. - SpeechInputBubbleBase creates the appropriate skia bitmap for the volume indicator and passes to the platform specific code for display. - As part of the above SpeechInputBubbleController addition for volume level, I wrote a single function to process all calls received by it and handled in the UI thread for simplicity. BUG=53598 TEST=updated existing tests. Also test manually, use speech input and verify the audio level changes appropriately in the UI as mic is moved near and far. Review URL: http://codereview.chromium.org/3384005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech/endpointer/endpointer_unittest.cc')
-rw-r--r--chrome/browser/speech/endpointer/endpointer_unittest.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/speech/endpointer/endpointer_unittest.cc b/chrome/browser/speech/endpointer/endpointer_unittest.cc
index b49a6a6..bbdc572 100644
--- a/chrome/browser/speech/endpointer/endpointer_unittest.cc
+++ b/chrome/browser/speech/endpointer/endpointer_unittest.cc
@@ -74,7 +74,7 @@ class EnergyEndpointerFrameProcessor : public FrameProcessor {
: endpointer_(endpointer) {}
EpStatus ProcessFrame(int64 time, int16* samples, int frame_size) {
- endpointer_->ProcessAudioFrame(time, samples, kFrameSize);
+ endpointer_->ProcessAudioFrame(time, samples, kFrameSize, NULL);
int64 ep_time;
return endpointer_->Status(&ep_time);
}
@@ -117,7 +117,7 @@ class EndpointerFrameProcessor : public FrameProcessor {
: endpointer_(endpointer) {}
EpStatus ProcessFrame(int64 time, int16* samples, int frame_size) {
- endpointer_->ProcessAudio(samples, kFrameSize);
+ endpointer_->ProcessAudio(samples, kFrameSize, NULL);
int64 ep_time;
return endpointer_->Status(&ep_time);
}