Index: chrome/browser/resources/access_chromevox/audio/background/local_tts_server_engine.js |
=================================================================== |
--- chrome/browser/resources/access_chromevox/audio/background/local_tts_server_engine.js (revision 0) |
+++ chrome/browser/resources/access_chromevox/audio/background/local_tts_server_engine.js (revision 0) |
@@ -0,0 +1,62 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+/** |
+ * @fileoverview Text-To-Speech engine that is running as a local server. |
+ */ |
+ |
+goog.provide('cvox.ChromeVoxLocalTtsServerEngine'); |
+ |
+goog.require('cvox.AbstractTts'); |
+ |
+/** |
+ * @constructor |
+ * @extends {cvox.AbstractTts} |
+ */ |
+cvox.ChromeVoxLocalTtsServerEngine = function() { |
+ //Inherit AbstractTts |
+ cvox.AbstractTts.call(this); |
+}; |
+goog.inherits(cvox.ChromeVoxLocalTtsServerEngine, cvox.AbstractTts); |
+ |
+/** |
+ * @return {string} The human-readable name of the speech engine. |
+ */ |
+cvox.ChromeVoxLocalTtsServerEngine.prototype.getName = function() { |
+ return 'Local Speech'; |
+}; |
+ |
+/** |
+ * Speaks the given string using the specified queueMode and properties. |
+ * @param {string} textString The string of text to be spoken. |
+ * @param {number=} queueMode The queue mode: AbstractTts.QUEUE_MODE_FLUSH |
+ * for flush, AbstractTts.QUEUE_MODE_QUEUE for adding to queue. |
+ * @param {Object=} properties Speech properties to use for this utterance. |
+ */ |
+cvox.ChromeVoxLocalTtsServerEngine.prototype.speak = function( |
+ textString, queueMode, properties) { |
+ cvox.ChromeVoxLocalTtsServerEngine.superClass_.speak.call(this, |
+ textString, queueMode, properties); |
+ //This is VERY hacky, but it works as a demo |
+ var theScript = document.createElement('script'); |
+ theScript.type = 'text/javascript'; |
+ theScript.src = 'http://localhost/' + textString; |
+ document.getElementsByTagName('head')[0].appendChild(theScript); |
+}; |
+ |
+/** |
+ * @return {boolean} True if the TTS is speaking. |
+ */ |
+cvox.ChromeVoxLocalTtsServerEngine.prototype.isSpeaking = function() { |
+ cvox.ChromeVoxLocalTtsServerEngine.superClass_.isSpeaking.call(this); |
+ return false; |
+}; |
+ |
+/** |
+ * Stops speech. |
+ */ |
+cvox.ChromeVoxLocalTtsServerEngine.prototype.stop = function() { |
+ cvox.ChromeVoxLocalTtsServerEngine.superClass_.stop.call(this); |
+ this.speak(''); |
+}; |
Property changes on: chrome/browser/resources/access_chromevox/audio/background/local_tts_server_engine.js |
___________________________________________________________________ |
Added: svn:executable |
+ * |
Added: svn:eol-style |
+ LF |