diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 12:07:57 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 12:07:57 +0000 |
commit | fc89d8ae5916652cce7a00f5adac4d0e812b5c16 (patch) | |
tree | d728195ba6ca3244adb47ff9e21dc971abb5f625 /chrome/browser/cocoa | |
parent | fda165787a252f0fd424f7137619f0bf0c1482dd (diff) | |
download | chromium_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/cocoa')
-rw-r--r-- | chrome/browser/cocoa/speech_input_window_controller.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/speech_input_window_controller.mm b/chrome/browser/cocoa/speech_input_window_controller.mm index 24d7cfe..c3dae85 100644 --- a/chrome/browser/cocoa/speech_input_window_controller.mm +++ b/chrome/browser/cocoa/speech_input_window_controller.mm @@ -44,7 +44,7 @@ const int kBubbleHorizontalMargin = 15; // Space on either sides of controls. NSWindow* window = [self window]; [[self bubble] setArrowLocation:info_bubble::kTopLeft]; NSImage* icon = ResourceBundle::GetSharedInstance().GetNSImageNamed( - IDR_SPEECH_INPUT_RECORDING); + IDR_SPEECH_INPUT_MIC_EMPTY); [iconImage_ setImage:icon]; [iconImage_ setNeedsDisplay:YES]; @@ -76,7 +76,7 @@ const int kBubbleHorizontalMargin = 15; // Space on either sides of controls. int newWidth = size.width; NSImage* icon = ResourceBundle::GetSharedInstance().GetNSImageNamed( - IDR_SPEECH_INPUT_RECORDING); + IDR_SPEECH_INPUT_MIC_EMPTY); size = [icon size]; newHeight += size.height + kBubbleControlVerticalSpacing; if (newWidth < size.width) |