OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The <code>chrome.hotwordPrivate</code> API allows extensions to access and | 5 // The <code>chrome.hotwordPrivate</code> API allows extensions to access and |
6 // mutate the preference for enabling hotword search. It also provides | 6 // mutate the preference for enabling hotword search. It also provides |
7 // information on whether the hotword search is available. This API provides an | 7 // information on whether the hotword search is available. This API provides an |
8 // event interface to transmit to the extension a signal that the preference fo | 8 // event interface to transmit to the extension a signal that the preference fo |
9 // hotword search has change. | 9 // hotword search has change. |
10 // | 10 // |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Whether the sound of "Ok, Google" plus a few seconds before is sent | 26 // Whether the sound of "Ok, Google" plus a few seconds before is sent |
27 // back to Google. | 27 // back to Google. |
28 boolean audioLoggingEnabled; | 28 boolean audioLoggingEnabled; |
29 | 29 |
30 // Whether experimental hotwording functionality is enabled. Mirrors the | 30 // Whether experimental hotwording functionality is enabled. Mirrors the |
31 // "enable-experimental-hotwording" flag. | 31 // "enable-experimental-hotwording" flag. |
32 boolean experimentalHotwordEnabled; | 32 boolean experimentalHotwordEnabled; |
33 | 33 |
34 // Whether always-on hotwording is enabled. | 34 // Whether always-on hotwording is enabled. |
35 boolean alwaysOnEnabled; | 35 boolean alwaysOnEnabled; |
| 36 |
| 37 // Whether training mode is enabled. |
| 38 boolean trainingEnabled; |
36 }; | 39 }; |
37 | 40 |
38 dictionary LaunchState { | 41 dictionary LaunchState { |
39 // TODO(kcarattini): Consider adding more variables here, | 42 // TODO(kcarattini): Consider adding more variables here, |
40 // such as the available state of the hotword service. | 43 // such as the available state of the hotword service. |
41 | 44 |
42 // The mode that the Hotword Audio Verification app was launched in. | 45 // The mode that the Hotword Audio Verification app was launched in. |
43 long launchMode; | 46 long launchMode; |
44 }; | 47 }; |
45 | 48 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 optional GenericDoneCallback callback); | 81 optional GenericDoneCallback callback); |
79 | 82 |
80 // Notifies that a hotword has been recognized in the browser-requested | 83 // Notifies that a hotword has been recognized in the browser-requested |
81 // hotword session. | 84 // hotword session. |
82 static void notifyHotwordRecognition(HotwordType type, | 85 static void notifyHotwordRecognition(HotwordType type, |
83 optional GenericDoneCallback callback); | 86 optional GenericDoneCallback callback); |
84 | 87 |
85 // Retrieves the state that the Hotword Audio Verification app was | 88 // Retrieves the state that the Hotword Audio Verification app was |
86 // launched in. The result is put into a LaunchState object. | 89 // launched in. The result is put into a LaunchState object. |
87 static void getLaunchState(LaunchStateCallback callback); | 90 static void getLaunchState(LaunchStateCallback callback); |
| 91 |
| 92 // Starts the speaker model training. |
| 93 static void startTraining(optional GenericDoneCallback callback); |
| 94 |
| 95 // Finalizess the speaker model. |
| 96 static void finalizeSpeakerModel(optional GenericDoneCallback callback); |
| 97 |
| 98 // Stops the speaker model training. |
| 99 static void stopTraining(optional GenericDoneCallback callback); |
88 }; | 100 }; |
89 | 101 |
90 interface Events { | 102 interface Events { |
91 // Fired when the hotword search enabled preference is changed. | 103 // Fired when the hotword detector enabled state should be changed. |
| 104 // This can be from various sources, e.g. a pref change or training |
| 105 // a speaker model. |
92 static void onEnabledChanged(); | 106 static void onEnabledChanged(); |
93 | 107 |
94 // Fired when the browser wants to start a hotword session. | 108 // Fired when the browser wants to start a hotword session. |
95 static void onHotwordSessionRequested(); | 109 static void onHotwordSessionRequested(); |
96 | 110 |
97 // Fired when the browser wants to stop the requested hotword session. | 111 // Fired when the browser wants to stop the requested hotword session. |
98 static void onHotwordSessionStopped(); | 112 static void onHotwordSessionStopped(); |
| 113 |
| 114 // Fired when the speaker model should be finalized. |
| 115 static void onFinalizeSpeakerModel(); |
| 116 |
| 117 // Fired when a hotword has triggered. |
| 118 static void onHotwordTriggered(); |
99 }; | 119 }; |
100 }; | 120 }; |
OLD | NEW |