Chromium Code Reviews| Index: chrome/browser/resources/hotword/state_manager.js |
| diff --git a/chrome/browser/resources/hotword/state_manager.js b/chrome/browser/resources/hotword/state_manager.js |
| index 2727cbcd8af7cf76ee799f1d8790d071e2cc9d3a..764d2c099dd202f5b81f9d123d2a4195da6d1373 100644 |
| --- a/chrome/browser/resources/hotword/state_manager.js |
| +++ b/chrome/browser/resources/hotword/state_manager.js |
| @@ -43,8 +43,19 @@ cr.define('hotword', function() { |
| */ |
| this.sessionStartedCb_ = null; |
| + /** |
| + * Hotword trigger audio notification... a.k.a The Chime (tm). |
| + * @private {!Audio} |
| + */ |
| + this.chime_ = document.createElement('audio'); |
| + |
| // Get the initial status. |
| chrome.hotwordPrivate.getStatus(this.handleStatus_.bind(this)); |
| + |
| + // Setup the chime and insert into the page. |
| + this.chime_.src = chrome.extension.getURL( |
| + hotword.constants.SHARED_MODULE_ROOT + '/audio/chime.wav'); |
| + document.body.appendChild(this.chime_); |
|
Dan Beam
2014/09/23 03:43:13
what happens if this fails to load?
Anand Mistry (off Chromium)
2014/09/24 01:35:02
There'll be a warning on the console for this exte
|
| } |
| /** |
| @@ -227,6 +238,9 @@ cr.define('hotword', function() { |
| // Detector implicitly stops when the hotword is detected. |
| this.state_ = State_.STOPPED; |
| + // Play the chime. |
| + this.chime_.play(); |
|
Dan Beam
2014/09/23 03:43:13
can this handle being called before the sound stop
Anand Mistry (off Chromium)
2014/09/24 01:35:02
The sound is shorter than 1 second. I don't think
|
| + |
| chrome.hotwordPrivate.notifyHotwordRecognition('search', function() {}); |
| // Implicitly clear the session. A session needs to be started in order to |