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 A composite TTS sends allows ChromeVox to use | 6 * @fileoverview A composite TTS sends allows ChromeVox to use |
7 * multiple TTS engines at the same time. | 7 * multiple TTS engines at the same time. |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
11 goog.provide('cvox.CompositeTts'); | 11 goog.provide('cvox.CompositeTts'); |
12 | 12 |
13 goog.require('cvox.TtsInterface'); | 13 goog.require('cvox.TtsInterface'); |
14 | 14 |
15 /** | 15 /** |
16 * A Composite Tts | 16 * A Composite Tts |
17 * @constructor | 17 * @constructor |
18 * @implements {cvox.TtsInterface} | 18 * @implements {cvox.TtsInterface} |
19 */ | 19 */ |
20 cvox.CompositeTts = function() { | 20 cvox.CompositeTts = function() { |
21 /** | 21 /** |
22 * @type {Array.<cvox.TtsInterface>} | 22 * @type {Array<cvox.TtsInterface>} |
23 * @private | 23 * @private |
24 */ | 24 */ |
25 this.ttsEngines_ = []; | 25 this.ttsEngines_ = []; |
26 }; | 26 }; |
27 | 27 |
28 | 28 |
29 /** | 29 /** |
30 * Adds a TTS engine to the composite TTS | 30 * Adds a TTS engine to the composite TTS |
31 * @param {cvox.TtsInterface} tts The TTS to add. | 31 * @param {cvox.TtsInterface} tts The TTS to add. |
32 * @return {cvox.CompositeTts} this. | 32 * @return {cvox.CompositeTts} this. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 * @override | 94 * @override |
95 */ | 95 */ |
96 cvox.CompositeTts.prototype.getDefaultProperty = function(property) { | 96 cvox.CompositeTts.prototype.getDefaultProperty = function(property) { |
97 for (var i = 0, engine; engine = this.ttsEngines_[i]; i++) { | 97 for (var i = 0, engine; engine = this.ttsEngines_[i]; i++) { |
98 var value = engine.getDefaultProperty(property); | 98 var value = engine.getDefaultProperty(property); |
99 if (value) { | 99 if (value) { |
100 return value; | 100 return value; |
101 } | 101 } |
102 } | 102 } |
103 }; | 103 }; |
OLD | NEW |