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 /** | 5 /** |
6 * @fileoverview Defines a Tts interface. | 6 * @fileoverview Defines a Tts interface. |
7 * | 7 * |
8 * All TTS engines in ChromeVox conform to the this interface. | 8 * All TTS engines in ChromeVox conform to the this interface. |
9 * | 9 * |
10 */ | 10 */ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 * properties['category']) from the queue, then enqueue this utterance. | 45 * properties['category']) from the queue, then enqueue this utterance. |
46 */ | 46 */ |
47 CATEGORY_FLUSH: 2 | 47 CATEGORY_FLUSH: 2 |
48 }; | 48 }; |
49 | 49 |
50 /** | 50 /** |
51 * @interface | 51 * @interface |
52 * An interface for clients who want to get notified when an utterance | 52 * An interface for clients who want to get notified when an utterance |
53 * starts or ends from any source. | 53 * starts or ends from any source. |
54 */ | 54 */ |
55 cvox.TtsCapturingEventListener = function() { }; | 55 cvox.TtsCapturingEventListener = function() {}; |
56 | 56 |
57 /** | 57 /** |
58 * Called when any utterance starts. | 58 * Called when any utterance starts. |
59 */ | 59 */ |
60 cvox.TtsCapturingEventListener.prototype.onTtsStart = function() { }; | 60 cvox.TtsCapturingEventListener.prototype.onTtsStart = function() {}; |
61 | 61 |
62 /** | 62 /** |
63 * Called when any utterance ends. | 63 * Called when any utterance ends. |
64 */ | 64 */ |
65 cvox.TtsCapturingEventListener.prototype.onTtsEnd = function() { }; | 65 cvox.TtsCapturingEventListener.prototype.onTtsEnd = function() {}; |
66 | 66 |
67 /** | 67 /** |
68 * Called when any utterance gets interrupted. | 68 * Called when any utterance gets interrupted. |
69 */ | 69 */ |
70 cvox.TtsCapturingEventListener.prototype.onTtsInterrupted = function() { }; | 70 cvox.TtsCapturingEventListener.prototype.onTtsInterrupted = function() {}; |
71 | 71 |
72 /** | 72 /** |
73 * @interface | 73 * @interface |
74 */ | 74 */ |
75 cvox.TtsInterface = function() { }; | 75 cvox.TtsInterface = function() {}; |
76 | 76 |
77 /** | 77 /** |
78 * Speaks the given string using the specified queueMode and properties. | 78 * Speaks the given string using the specified queueMode and properties. |
79 * @param {string} textString The string of text to be spoken. | 79 * @param {string} textString The string of text to be spoken. |
80 * @param {cvox.QueueMode} queueMode The queue mode to use for speaking. | 80 * @param {cvox.QueueMode} queueMode The queue mode to use for speaking. |
81 * @param {Object=} properties Speech properties to use for this utterance. | 81 * @param {Object=} properties Speech properties to use for this utterance. |
82 * @return {cvox.TtsInterface} A tts object useful for chaining speak calls. | 82 * @return {cvox.TtsInterface} A tts object useful for chaining speak calls. |
83 */ | 83 */ |
84 cvox.TtsInterface.prototype.speak = | 84 cvox.TtsInterface.prototype.speak = function( |
85 function(textString, queueMode, properties) { }; | 85 textString, queueMode, properties) {}; |
86 | 86 |
87 | 87 |
88 /** | 88 /** |
89 * Returns true if the TTS is currently speaking. | 89 * Returns true if the TTS is currently speaking. |
90 * @return {boolean} True if the TTS is speaking. | 90 * @return {boolean} True if the TTS is speaking. |
91 */ | 91 */ |
92 cvox.TtsInterface.prototype.isSpeaking = function() { }; | 92 cvox.TtsInterface.prototype.isSpeaking = function() {}; |
93 | 93 |
94 | 94 |
95 /** | 95 /** |
96 * Stops speech. | 96 * Stops speech. |
97 */ | 97 */ |
98 cvox.TtsInterface.prototype.stop = function() { }; | 98 cvox.TtsInterface.prototype.stop = function() {}; |
99 | 99 |
100 /** | 100 /** |
101 * Adds a listener to get called whenever any utterance starts or ends. | 101 * Adds a listener to get called whenever any utterance starts or ends. |
102 * @param {cvox.TtsCapturingEventListener} listener Listener to get called. | 102 * @param {cvox.TtsCapturingEventListener} listener Listener to get called. |
103 */ | 103 */ |
104 cvox.TtsInterface.prototype.addCapturingEventListener = function(listener) { }; | 104 cvox.TtsInterface.prototype.addCapturingEventListener = function(listener) {}; |
105 | 105 |
106 /** | 106 /** |
107 * Increases a TTS speech property. | 107 * Increases a TTS speech property. |
108 * @param {string} propertyName The name of the property to change. | 108 * @param {string} propertyName The name of the property to change. |
109 * @param {boolean} increase If true, increases the property value by one | 109 * @param {boolean} increase If true, increases the property value by one |
110 * step size, otherwise decreases. | 110 * step size, otherwise decreases. |
111 */ | 111 */ |
112 cvox.TtsInterface.prototype.increaseOrDecreaseProperty = | 112 cvox.TtsInterface.prototype.increaseOrDecreaseProperty = function( |
113 function(propertyName, increase) { }; | 113 propertyName, increase) {}; |
114 | 114 |
115 | 115 |
116 /** | 116 /** |
117 * Converts an engine property value to a percentage from 0.00 to 1.00. | 117 * Converts an engine property value to a percentage from 0.00 to 1.00. |
118 * @param {string} property The property to convert. | 118 * @param {string} property The property to convert. |
119 * @return {?number} The percentage of the property. | 119 * @return {?number} The percentage of the property. |
120 */ | 120 */ |
121 cvox.TtsInterface.prototype.propertyToPercentage = function(property) { }; | 121 cvox.TtsInterface.prototype.propertyToPercentage = function(property) {}; |
122 | 122 |
123 | 123 |
124 /** | 124 /** |
125 * Returns the default properties of the first tts that has default properties. | 125 * Returns the default properties of the first tts that has default properties. |
126 * @param {string} property Name of property. | 126 * @param {string} property Name of property. |
127 * @return {?number} The default value. | 127 * @return {?number} The default value. |
128 */ | 128 */ |
129 cvox.TtsInterface.prototype.getDefaultProperty = function(property) { }; | 129 cvox.TtsInterface.prototype.getDefaultProperty = function(property) {}; |
130 | 130 |
131 /** | 131 /** |
132 * Toggles on or off speech. | 132 * Toggles on or off speech. |
133 * @return {boolean} Whether speech is now on or off. | 133 * @return {boolean} Whether speech is now on or off. |
134 */ | 134 */ |
135 cvox.TtsInterface.prototype.toggleSpeechOnOrOff = function() {}; | 135 cvox.TtsInterface.prototype.toggleSpeechOnOrOff = function() {}; |
OLD | NEW |