Commit 7590f797 authored by amistry's avatar amistry Committed by Commit bot

Play a chime when the hotword is triggered.

BUG=397019

Review URL: https://codereview.chromium.org/545373005

Cr-Commit-Position: refs/heads/master@{#296343}
parent 6cf222b3
...@@ -43,8 +43,19 @@ cr.define('hotword', function() { ...@@ -43,8 +43,19 @@ cr.define('hotword', function() {
*/ */
this.sessionStartedCb_ = null; this.sessionStartedCb_ = null;
/**
* Hotword trigger audio notification... a.k.a The Chime (tm).
* @private {!Audio}
*/
this.chime_ = document.createElement('audio');
// Get the initial status. // Get the initial status.
chrome.hotwordPrivate.getStatus(this.handleStatus_.bind(this)); 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_);
} }
/** /**
...@@ -227,6 +238,9 @@ cr.define('hotword', function() { ...@@ -227,6 +238,9 @@ cr.define('hotword', function() {
// Detector implicitly stops when the hotword is detected. // Detector implicitly stops when the hotword is detected.
this.state_ = State_.STOPPED; this.state_ = State_.STOPPED;
// Play the chime.
this.chime_.play();
chrome.hotwordPrivate.notifyHotwordRecognition('search', function() {}); chrome.hotwordPrivate.notifyHotwordRecognition('search', function() {});
// Implicitly clear the session. A session needs to be started in order to // Implicitly clear the session. A session needs to be started in order to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment