/documentation/tts/com/google/tts/TextToSpeechBeta.html

http://eyes-free.googlecode.com/ · HTML · 1064 lines · 936 code · 104 blank · 24 comment · 0 complexity · f10bb1cbe3998f9080b42b66a21bda5a MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0_16) on Fri Oct 09 19:06:10 PDT 2009 -->
  6. <TITLE>
  7. TextToSpeechBeta
  8. </TITLE>
  9. <META NAME="date" CONTENT="2009-10-09">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="TextToSpeechBeta";
  16. }
  17. }
  18. </SCRIPT>
  19. <NOSCRIPT>
  20. </NOSCRIPT>
  21. </HEAD>
  22. <BODY BGCOLOR="white" onload="windowTitle();">
  23. <HR>
  24. <!-- ========= START OF TOP NAVBAR ======= -->
  25. <A NAME="navbar_top"><!-- --></A>
  26. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  27. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  28. <TR>
  29. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  30. <A NAME="navbar_top_firstrow"><!-- --></A>
  31. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  32. <TR ALIGN="center" VALIGN="top">
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/google/tts/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  35. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  36. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  37. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  38. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  39. </TR>
  40. </TABLE>
  41. </TD>
  42. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  43. </EM>
  44. </TD>
  45. </TR>
  46. <TR>
  47. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  48. &nbsp;PREV CLASS&nbsp;
  49. &nbsp;<A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html" title="class in com.google.tts"><B>NEXT CLASS</B></A></FONT></TD>
  50. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  51. <A HREF="../../../index.html?com/google/tts/TextToSpeechBeta.html" target="_top"><B>FRAMES</B></A> &nbsp;
  52. &nbsp;<A HREF="TextToSpeechBeta.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  53. &nbsp;<SCRIPT type="text/javascript">
  54. <!--
  55. if(window==top) {
  56. document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  57. }
  58. //-->
  59. </SCRIPT>
  60. <NOSCRIPT>
  61. <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  62. </NOSCRIPT>
  63. </FONT></TD>
  64. </TR>
  65. <TR>
  66. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  67. SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  68. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  69. DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  70. </TR>
  71. </TABLE>
  72. <A NAME="skip-navbar_top"></A>
  73. <!-- ========= END OF TOP NAVBAR ========= -->
  74. <HR>
  75. <!-- ======== START OF CLASS DATA ======== -->
  76. <H2>
  77. <FONT SIZE="-1">
  78. com.google.tts</FONT>
  79. <BR>
  80. Class TextToSpeechBeta</H2>
  81. <PRE>
  82. java.lang.Object
  83. <IMG SRC="../../../resources/inherit.gif" ALT="extended by ">TextToSpeech
  84. <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.google.tts.TextToSpeechBeta</B>
  85. </PRE>
  86. <HR>
  87. <DL>
  88. <DT><PRE>public class <B>TextToSpeechBeta</B><DT>extends TextToSpeech</DL>
  89. </PRE>
  90. <P>
  91. Synthesizes speech from text for immediate playback or to create a sound
  92. file.
  93. <p>
  94. A TextToSpeech instance can only be used to synthesize text once it has
  95. completed its initialization. Implement the
  96. <A HREF="../../../com/google/tts/TextToSpeechBeta.OnInitListener.html" title="interface in com.google.tts"><CODE>TextToSpeechBeta.OnInitListener</CODE></A> to be notified of the completion of
  97. the initialization.<br>
  98. When you are done using the TextToSpeech instance, call the
  99. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#shutdown()"><CODE>shutdown()</CODE></A> method to release the native resources used by the
  100. TextToSpeech engine.
  101. <P>
  102. <P>
  103. <HR>
  104. <P>
  105. <!-- ======== NESTED CLASS SUMMARY ======== -->
  106. <A NAME="nested_class_summary"><!-- --></A>
  107. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  108. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  109. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  110. <B>Nested Class Summary</B></FONT></TH>
  111. </TR>
  112. <TR BGCOLOR="white" CLASS="TableRowColor">
  113. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  114. <CODE>&nbsp;class</CODE></FONT></TD>
  115. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html" title="class in com.google.tts">TextToSpeechBeta.Engine</A></B></CODE>
  116. <BR>
  117. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Internal constants for the TextToSpeech functionality</TD>
  118. </TR>
  119. <TR BGCOLOR="white" CLASS="TableRowColor">
  120. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  121. <CODE>static&nbsp;interface</CODE></FONT></TD>
  122. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.OnInitListener.html" title="interface in com.google.tts">TextToSpeechBeta.OnInitListener</A></B></CODE>
  123. <BR>
  124. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface definition of a callback to be invoked indicating the completion
  125. of the TextToSpeech engine initialization.</TD>
  126. </TR>
  127. <TR BGCOLOR="white" CLASS="TableRowColor">
  128. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  129. <CODE>static&nbsp;interface</CODE></FONT></TD>
  130. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.OnUtteranceCompletedListener.html" title="interface in com.google.tts">TextToSpeechBeta.OnUtteranceCompletedListener</A></B></CODE>
  131. <BR>
  132. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface definition of a callback to be invoked indicating the
  133. TextToSpeech engine has completed synthesizing an utterance with an
  134. utterance ID set.</TD>
  135. </TR>
  136. </TABLE>
  137. &nbsp;<!-- =========== FIELD SUMMARY =========== -->
  138. <A NAME="field_summary"><!-- --></A>
  139. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  140. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  141. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  142. <B>Field Summary</B></FONT></TH>
  143. </TR>
  144. <TR BGCOLOR="white" CLASS="TableRowColor">
  145. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  146. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  147. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#ACTION_TTS_QUEUE_PROCESSING_COMPLETED">ACTION_TTS_QUEUE_PROCESSING_COMPLETED</A></B></CODE>
  148. <BR>
  149. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Broadcast Action: The TextToSpeech synthesizer has completed processing of
  150. all the text in the speech queue.</TD>
  151. </TR>
  152. <TR BGCOLOR="white" CLASS="TableRowColor">
  153. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  154. <CODE>static&nbsp;int</CODE></FONT></TD>
  155. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR">ERROR</A></B></CODE>
  156. <BR>
  157. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes a generic operation failure.</TD>
  158. </TR>
  159. <TR BGCOLOR="white" CLASS="TableRowColor">
  160. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  161. <CODE>static&nbsp;int</CODE></FONT></TD>
  162. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_AVAILABLE">LANG_AVAILABLE</A></B></CODE>
  163. <BR>
  164. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes the language is available for the language by the locale, but not
  165. the country and variant.</TD>
  166. </TR>
  167. <TR BGCOLOR="white" CLASS="TableRowColor">
  168. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  169. <CODE>static&nbsp;int</CODE></FONT></TD>
  170. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_COUNTRY_AVAILABLE">LANG_COUNTRY_AVAILABLE</A></B></CODE>
  171. <BR>
  172. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes the language is available for the language and country specified by
  173. the locale, but not the variant.</TD>
  174. </TR>
  175. <TR BGCOLOR="white" CLASS="TableRowColor">
  176. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  177. <CODE>static&nbsp;int</CODE></FONT></TD>
  178. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_COUNTRY_VAR_AVAILABLE">LANG_COUNTRY_VAR_AVAILABLE</A></B></CODE>
  179. <BR>
  180. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes the language is available exactly as specified by the locale.</TD>
  181. </TR>
  182. <TR BGCOLOR="white" CLASS="TableRowColor">
  183. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  184. <CODE>static&nbsp;int</CODE></FONT></TD>
  185. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_MISSING_DATA">LANG_MISSING_DATA</A></B></CODE>
  186. <BR>
  187. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes the language data is missing.</TD>
  188. </TR>
  189. <TR BGCOLOR="white" CLASS="TableRowColor">
  190. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  191. <CODE>static&nbsp;int</CODE></FONT></TD>
  192. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_NOT_SUPPORTED">LANG_NOT_SUPPORTED</A></B></CODE>
  193. <BR>
  194. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes the language is not supported.</TD>
  195. </TR>
  196. <TR BGCOLOR="white" CLASS="TableRowColor">
  197. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  198. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  199. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#NOT_ON_PLATFORM_TTS">NOT_ON_PLATFORM_TTS</A></B></CODE>
  200. <BR>
  201. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  202. </TR>
  203. <TR BGCOLOR="white" CLASS="TableRowColor">
  204. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  205. <CODE>static&nbsp;int</CODE></FONT></TD>
  206. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_ADD">QUEUE_ADD</A></B></CODE>
  207. <BR>
  208. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Queue mode where the new entry is added at the end of the playback queue.</TD>
  209. </TR>
  210. <TR BGCOLOR="white" CLASS="TableRowColor">
  211. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  212. <CODE>static&nbsp;int</CODE></FONT></TD>
  213. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_FLUSH">QUEUE_FLUSH</A></B></CODE>
  214. <BR>
  215. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Queue mode where all entries in the playback queue (media to be played and
  216. text to be synthesized) are dropped and replaced by the new entry.</TD>
  217. </TR>
  218. <TR BGCOLOR="white" CLASS="TableRowColor">
  219. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  220. <CODE>static&nbsp;int</CODE></FONT></TD>
  221. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS">SUCCESS</A></B></CODE>
  222. <BR>
  223. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Denotes a successful operation.</TD>
  224. </TR>
  225. <TR BGCOLOR="white" CLASS="TableRowColor">
  226. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  227. <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
  228. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#USING_PLATFORM_TTS">USING_PLATFORM_TTS</A></B></CODE>
  229. <BR>
  230. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  231. </TR>
  232. </TABLE>
  233. &nbsp;
  234. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  235. <A NAME="constructor_summary"><!-- --></A>
  236. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  237. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  238. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  239. <B>Constructor Summary</B></FONT></TH>
  240. </TR>
  241. <TR BGCOLOR="white" CLASS="TableRowColor">
  242. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#TextToSpeechBeta(Context, com.google.tts.TextToSpeechBeta.OnInitListener)">TextToSpeechBeta</A></B>(Context&nbsp;context,
  243. <A HREF="../../../com/google/tts/TextToSpeechBeta.OnInitListener.html" title="interface in com.google.tts">TextToSpeechBeta.OnInitListener</A>&nbsp;listener)</CODE>
  244. <BR>
  245. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The constructor for the TextToSpeech class.</TD>
  246. </TR>
  247. </TABLE>
  248. &nbsp;
  249. <!-- ========== METHOD SUMMARY =========== -->
  250. <A NAME="method_summary"><!-- --></A>
  251. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  252. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  253. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  254. <B>Method Summary</B></FONT></TH>
  255. </TR>
  256. <TR BGCOLOR="white" CLASS="TableRowColor">
  257. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  258. <CODE>&nbsp;int</CODE></FONT></TD>
  259. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#addEarcon(java.lang.String, java.lang.String)">addEarcon</A></B>(java.lang.String&nbsp;earcon,
  260. java.lang.String&nbsp;filename)</CODE>
  261. <BR>
  262. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a mapping between a string of text and a sound file.</TD>
  263. </TR>
  264. <TR BGCOLOR="white" CLASS="TableRowColor">
  265. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  266. <CODE>&nbsp;int</CODE></FONT></TD>
  267. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#addEarcon(java.lang.String, java.lang.String, int)">addEarcon</A></B>(java.lang.String&nbsp;earcon,
  268. java.lang.String&nbsp;packagename,
  269. int&nbsp;resourceId)</CODE>
  270. <BR>
  271. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a mapping between a string of text and a sound resource in a package.</TD>
  272. </TR>
  273. <TR BGCOLOR="white" CLASS="TableRowColor">
  274. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  275. <CODE>&nbsp;int</CODE></FONT></TD>
  276. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#addSpeech(java.lang.String, java.lang.String)">addSpeech</A></B>(java.lang.String&nbsp;text,
  277. java.lang.String&nbsp;filename)</CODE>
  278. <BR>
  279. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a mapping between a string of text and a sound file.</TD>
  280. </TR>
  281. <TR BGCOLOR="white" CLASS="TableRowColor">
  282. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  283. <CODE>&nbsp;int</CODE></FONT></TD>
  284. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#addSpeech(java.lang.String, java.lang.String, int)">addSpeech</A></B>(java.lang.String&nbsp;text,
  285. java.lang.String&nbsp;packagename,
  286. int&nbsp;resourceId)</CODE>
  287. <BR>
  288. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a mapping between a string of text and a sound resource in a package.</TD>
  289. </TR>
  290. <TR BGCOLOR="white" CLASS="TableRowColor">
  291. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  292. <CODE>&nbsp;java.util.Locale</CODE></FONT></TD>
  293. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#getLanguage()">getLanguage</A></B>()</CODE>
  294. <BR>
  295. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a Locale instance describing the language currently being used by
  296. the TextToSpeech engine.</TD>
  297. </TR>
  298. <TR BGCOLOR="white" CLASS="TableRowColor">
  299. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  300. <CODE>static&nbsp;boolean</CODE></FONT></TD>
  301. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#isInstalled(Context)">isInstalled</A></B>(Context&nbsp;ctx)</CODE>
  302. <BR>
  303. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Standalone TTS ONLY!
  304. Checks if the TTS service is installed or not</TD>
  305. </TR>
  306. <TR BGCOLOR="white" CLASS="TableRowColor">
  307. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  308. <CODE>&nbsp;int</CODE></FONT></TD>
  309. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#isLanguageAvailable(java.util.Locale)">isLanguageAvailable</A></B>(java.util.Locale&nbsp;loc)</CODE>
  310. <BR>
  311. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the specified language as represented by the Locale is available
  312. and supported.</TD>
  313. </TR>
  314. <TR BGCOLOR="white" CLASS="TableRowColor">
  315. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  316. <CODE>&nbsp;boolean</CODE></FONT></TD>
  317. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#isSpeaking()">isSpeaking</A></B>()</CODE>
  318. <BR>
  319. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether or not the TextToSpeech engine is busy speaking.</TD>
  320. </TR>
  321. <TR BGCOLOR="white" CLASS="TableRowColor">
  322. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  323. <CODE>&nbsp;int</CODE></FONT></TD>
  324. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#playEarcon(java.lang.String, int, java.util.HashMap)">playEarcon</A></B>(java.lang.String&nbsp;earcon,
  325. int&nbsp;queueMode,
  326. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params)</CODE>
  327. <BR>
  328. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays the earcon using the specified queueing mode and parameters.</TD>
  329. </TR>
  330. <TR BGCOLOR="white" CLASS="TableRowColor">
  331. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  332. <CODE>&nbsp;int</CODE></FONT></TD>
  333. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#playSilence(long, int, java.util.HashMap)">playSilence</A></B>(long&nbsp;durationInMs,
  334. int&nbsp;queueMode,
  335. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params)</CODE>
  336. <BR>
  337. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays silence for the specified amount of time using the specified queue
  338. mode.</TD>
  339. </TR>
  340. <TR BGCOLOR="white" CLASS="TableRowColor">
  341. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  342. <CODE>&nbsp;int</CODE></FONT></TD>
  343. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#setLanguage(java.util.Locale)">setLanguage</A></B>(java.util.Locale&nbsp;loc)</CODE>
  344. <BR>
  345. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the language for the TextToSpeech engine.</TD>
  346. </TR>
  347. <TR BGCOLOR="white" CLASS="TableRowColor">
  348. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  349. <CODE>&nbsp;int</CODE></FONT></TD>
  350. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#setOnUtteranceCompletedListener(com.google.tts.TextToSpeechBeta.OnUtteranceCompletedListener)">setOnUtteranceCompletedListener</A></B>(<A HREF="../../../com/google/tts/TextToSpeechBeta.OnUtteranceCompletedListener.html" title="interface in com.google.tts">TextToSpeechBeta.OnUtteranceCompletedListener</A>&nbsp;listener)</CODE>
  351. <BR>
  352. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the OnUtteranceCompletedListener that will fire when an utterance
  353. completes.</TD>
  354. </TR>
  355. <TR BGCOLOR="white" CLASS="TableRowColor">
  356. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  357. <CODE>&nbsp;int</CODE></FONT></TD>
  358. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#setPitch(float)">setPitch</A></B>(float&nbsp;pitch)</CODE>
  359. <BR>
  360. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the speech pitch for the TextToSpeech engine.</TD>
  361. </TR>
  362. <TR BGCOLOR="white" CLASS="TableRowColor">
  363. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  364. <CODE>&nbsp;int</CODE></FONT></TD>
  365. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#setSpeechRate(float)">setSpeechRate</A></B>(float&nbsp;speechRate)</CODE>
  366. <BR>
  367. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the speech rate for the TextToSpeech engine.</TD>
  368. </TR>
  369. <TR BGCOLOR="white" CLASS="TableRowColor">
  370. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  371. <CODE>&nbsp;void</CODE></FONT></TD>
  372. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#shutdown()">shutdown</A></B>()</CODE>
  373. <BR>
  374. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Releases the resources used by the TextToSpeech engine.</TD>
  375. </TR>
  376. <TR BGCOLOR="white" CLASS="TableRowColor">
  377. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  378. <CODE>&nbsp;int</CODE></FONT></TD>
  379. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#speak(java.lang.String, int, java.util.HashMap)">speak</A></B>(java.lang.String&nbsp;text,
  380. int&nbsp;queueMode,
  381. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params)</CODE>
  382. <BR>
  383. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Speaks the string using the specified queuing strategy and speech
  384. parameters.</TD>
  385. </TR>
  386. <TR BGCOLOR="white" CLASS="TableRowColor">
  387. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  388. <CODE>&nbsp;int</CODE></FONT></TD>
  389. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#stop()">stop</A></B>()</CODE>
  390. <BR>
  391. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupts the current utterance (whether played or rendered to file) and
  392. discards other utterances in the queue.</TD>
  393. </TR>
  394. <TR BGCOLOR="white" CLASS="TableRowColor">
  395. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  396. <CODE>&nbsp;int</CODE></FONT></TD>
  397. <TD><CODE><B><A HREF="../../../com/google/tts/TextToSpeechBeta.html#synthesizeToFile(java.lang.String, java.util.HashMap, java.lang.String)">synthesizeToFile</A></B>(java.lang.String&nbsp;text,
  398. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params,
  399. java.lang.String&nbsp;filename)</CODE>
  400. <BR>
  401. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Synthesizes the given text to a file using the specified parameters.</TD>
  402. </TR>
  403. </TABLE>
  404. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  405. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  406. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  407. <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
  408. </TR>
  409. <TR BGCOLOR="white" CLASS="TableRowColor">
  410. <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
  411. </TR>
  412. </TABLE>
  413. &nbsp;
  414. <P>
  415. <!-- ============ FIELD DETAIL =========== -->
  416. <A NAME="field_detail"><!-- --></A>
  417. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  418. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  419. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  420. <B>Field Detail</B></FONT></TH>
  421. </TR>
  422. </TABLE>
  423. <A NAME="USING_PLATFORM_TTS"><!-- --></A><H3>
  424. USING_PLATFORM_TTS</H3>
  425. <PRE>
  426. public static final java.lang.String <B>USING_PLATFORM_TTS</B></PRE>
  427. <DL>
  428. <DL>
  429. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.USING_PLATFORM_TTS">Constant Field Values</A></DL>
  430. </DL>
  431. <HR>
  432. <A NAME="NOT_ON_PLATFORM_TTS"><!-- --></A><H3>
  433. NOT_ON_PLATFORM_TTS</H3>
  434. <PRE>
  435. public static final java.lang.String <B>NOT_ON_PLATFORM_TTS</B></PRE>
  436. <DL>
  437. <DL>
  438. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.NOT_ON_PLATFORM_TTS">Constant Field Values</A></DL>
  439. </DL>
  440. <HR>
  441. <A NAME="SUCCESS"><!-- --></A><H3>
  442. SUCCESS</H3>
  443. <PRE>
  444. public static final int <B>SUCCESS</B></PRE>
  445. <DL>
  446. <DD>Denotes a successful operation.
  447. <P>
  448. <DL>
  449. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.SUCCESS">Constant Field Values</A></DL>
  450. </DL>
  451. <HR>
  452. <A NAME="ERROR"><!-- --></A><H3>
  453. ERROR</H3>
  454. <PRE>
  455. public static final int <B>ERROR</B></PRE>
  456. <DL>
  457. <DD>Denotes a generic operation failure.
  458. <P>
  459. <DL>
  460. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.ERROR">Constant Field Values</A></DL>
  461. </DL>
  462. <HR>
  463. <A NAME="QUEUE_FLUSH"><!-- --></A><H3>
  464. QUEUE_FLUSH</H3>
  465. <PRE>
  466. public static final int <B>QUEUE_FLUSH</B></PRE>
  467. <DL>
  468. <DD>Queue mode where all entries in the playback queue (media to be played and
  469. text to be synthesized) are dropped and replaced by the new entry.
  470. <P>
  471. <DL>
  472. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.QUEUE_FLUSH">Constant Field Values</A></DL>
  473. </DL>
  474. <HR>
  475. <A NAME="QUEUE_ADD"><!-- --></A><H3>
  476. QUEUE_ADD</H3>
  477. <PRE>
  478. public static final int <B>QUEUE_ADD</B></PRE>
  479. <DL>
  480. <DD>Queue mode where the new entry is added at the end of the playback queue.
  481. <P>
  482. <DL>
  483. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.QUEUE_ADD">Constant Field Values</A></DL>
  484. </DL>
  485. <HR>
  486. <A NAME="LANG_COUNTRY_VAR_AVAILABLE"><!-- --></A><H3>
  487. LANG_COUNTRY_VAR_AVAILABLE</H3>
  488. <PRE>
  489. public static final int <B>LANG_COUNTRY_VAR_AVAILABLE</B></PRE>
  490. <DL>
  491. <DD>Denotes the language is available exactly as specified by the locale.
  492. <P>
  493. <DL>
  494. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.LANG_COUNTRY_VAR_AVAILABLE">Constant Field Values</A></DL>
  495. </DL>
  496. <HR>
  497. <A NAME="LANG_COUNTRY_AVAILABLE"><!-- --></A><H3>
  498. LANG_COUNTRY_AVAILABLE</H3>
  499. <PRE>
  500. public static final int <B>LANG_COUNTRY_AVAILABLE</B></PRE>
  501. <DL>
  502. <DD>Denotes the language is available for the language and country specified by
  503. the locale, but not the variant.
  504. <P>
  505. <DL>
  506. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.LANG_COUNTRY_AVAILABLE">Constant Field Values</A></DL>
  507. </DL>
  508. <HR>
  509. <A NAME="LANG_AVAILABLE"><!-- --></A><H3>
  510. LANG_AVAILABLE</H3>
  511. <PRE>
  512. public static final int <B>LANG_AVAILABLE</B></PRE>
  513. <DL>
  514. <DD>Denotes the language is available for the language by the locale, but not
  515. the country and variant.
  516. <P>
  517. <DL>
  518. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.LANG_AVAILABLE">Constant Field Values</A></DL>
  519. </DL>
  520. <HR>
  521. <A NAME="LANG_MISSING_DATA"><!-- --></A><H3>
  522. LANG_MISSING_DATA</H3>
  523. <PRE>
  524. public static final int <B>LANG_MISSING_DATA</B></PRE>
  525. <DL>
  526. <DD>Denotes the language data is missing.
  527. <P>
  528. <DL>
  529. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.LANG_MISSING_DATA">Constant Field Values</A></DL>
  530. </DL>
  531. <HR>
  532. <A NAME="LANG_NOT_SUPPORTED"><!-- --></A><H3>
  533. LANG_NOT_SUPPORTED</H3>
  534. <PRE>
  535. public static final int <B>LANG_NOT_SUPPORTED</B></PRE>
  536. <DL>
  537. <DD>Denotes the language is not supported.
  538. <P>
  539. <DL>
  540. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.LANG_NOT_SUPPORTED">Constant Field Values</A></DL>
  541. </DL>
  542. <HR>
  543. <A NAME="ACTION_TTS_QUEUE_PROCESSING_COMPLETED"><!-- --></A><H3>
  544. ACTION_TTS_QUEUE_PROCESSING_COMPLETED</H3>
  545. <PRE>
  546. public static final java.lang.String <B>ACTION_TTS_QUEUE_PROCESSING_COMPLETED</B></PRE>
  547. <DL>
  548. <DD>Broadcast Action: The TextToSpeech synthesizer has completed processing of
  549. all the text in the speech queue.
  550. <P>
  551. <DL>
  552. <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#com.google.tts.TextToSpeechBeta.ACTION_TTS_QUEUE_PROCESSING_COMPLETED">Constant Field Values</A></DL>
  553. </DL>
  554. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  555. <A NAME="constructor_detail"><!-- --></A>
  556. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  557. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  558. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  559. <B>Constructor Detail</B></FONT></TH>
  560. </TR>
  561. </TABLE>
  562. <A NAME="TextToSpeechBeta(Context, com.google.tts.TextToSpeechBeta.OnInitListener)"><!-- --></A><H3>
  563. TextToSpeechBeta</H3>
  564. <PRE>
  565. public <B>TextToSpeechBeta</B>(Context&nbsp;context,
  566. <A HREF="../../../com/google/tts/TextToSpeechBeta.OnInitListener.html" title="interface in com.google.tts">TextToSpeechBeta.OnInitListener</A>&nbsp;listener)</PRE>
  567. <DL>
  568. <DD>The constructor for the TextToSpeech class. This will also initialize the
  569. associated TextToSpeech engine if it isn't already running.
  570. <P>
  571. <DL>
  572. <DT><B>Parameters:</B><DD><CODE>context</CODE> - The context this instance is running in.<DD><CODE>listener</CODE> - The <A HREF="../../../com/google/tts/TextToSpeechBeta.OnInitListener.html" title="interface in com.google.tts"><CODE>TextToSpeechBeta.OnInitListener</CODE></A> that will be
  573. called when the TextToSpeech engine has initialized.</DL>
  574. </DL>
  575. <!-- ============ METHOD DETAIL ========== -->
  576. <A NAME="method_detail"><!-- --></A>
  577. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  578. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  579. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  580. <B>Method Detail</B></FONT></TH>
  581. </TR>
  582. </TABLE>
  583. <A NAME="shutdown()"><!-- --></A><H3>
  584. shutdown</H3>
  585. <PRE>
  586. public void <B>shutdown</B>()</PRE>
  587. <DL>
  588. <DD>Releases the resources used by the TextToSpeech engine. It is good practice
  589. for instance to call this method in the onDestroy() method of an Activity
  590. so the TextToSpeech engine can be cleanly stopped.
  591. <P>
  592. <DD><DL>
  593. </DL>
  594. </DD>
  595. </DL>
  596. <HR>
  597. <A NAME="addSpeech(java.lang.String, java.lang.String, int)"><!-- --></A><H3>
  598. addSpeech</H3>
  599. <PRE>
  600. public int <B>addSpeech</B>(java.lang.String&nbsp;text,
  601. java.lang.String&nbsp;packagename,
  602. int&nbsp;resourceId)</PRE>
  603. <DL>
  604. <DD>Adds a mapping between a string of text and a sound resource in a package.
  605. After a call to this method, subsequent calls to
  606. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#speak(java.lang.String, int, java.util.HashMap)"><CODE>speak(String, int, HashMap)</CODE></A> will play the specified sound resource
  607. if it is available, or synthesize the text it is missing.
  608. <P>
  609. <DD><DL>
  610. <DT><B>Parameters:</B><DD><CODE>text</CODE> - The string of text. Example: <code>"south_south_east"</code><DD><CODE>packagename</CODE> - Pass the packagename of the application that contains
  611. the resource. If the resource is in your own application (this is
  612. the most common case), then put the packagename of your application
  613. here.<br/>
  614. Example: <b>"com.google.marvin.compass"</b><br/>
  615. The packagename can be found in the AndroidManifest.xml of your
  616. application.
  617. <p>
  618. <code>&lt;manifest xmlns:android=&quot;...&quot;
  619. package=&quot;<b>com.google.marvin.compass</b>&quot;&gt;</code>
  620. </p><DD><CODE>resourceId</CODE> - Example: <code>R.raw.south_south_east</code>
  621. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  622. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  623. </DD>
  624. </DL>
  625. <HR>
  626. <A NAME="addSpeech(java.lang.String, java.lang.String)"><!-- --></A><H3>
  627. addSpeech</H3>
  628. <PRE>
  629. public int <B>addSpeech</B>(java.lang.String&nbsp;text,
  630. java.lang.String&nbsp;filename)</PRE>
  631. <DL>
  632. <DD>Adds a mapping between a string of text and a sound file. Using this, it is
  633. possible to add custom pronounciations for a string of text. After a call
  634. to this method, subsequent calls to <A HREF="../../../com/google/tts/TextToSpeechBeta.html#speak(java.lang.String, int, java.util.HashMap)"><CODE>speak(String, int, HashMap)</CODE></A>
  635. will play the specified sound resource if it is available, or synthesize
  636. the text it is missing.
  637. <P>
  638. <DD><DL>
  639. <DT><B>Parameters:</B><DD><CODE>text</CODE> - The string of text. Example: <code>"south_south_east"</code><DD><CODE>filename</CODE> - The full path to the sound file (for example:
  640. "/sdcard/mysounds/hello.wav")
  641. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  642. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  643. </DD>
  644. </DL>
  645. <HR>
  646. <A NAME="addEarcon(java.lang.String, java.lang.String, int)"><!-- --></A><H3>
  647. addEarcon</H3>
  648. <PRE>
  649. public int <B>addEarcon</B>(java.lang.String&nbsp;earcon,
  650. java.lang.String&nbsp;packagename,
  651. int&nbsp;resourceId)</PRE>
  652. <DL>
  653. <DD>Adds a mapping between a string of text and a sound resource in a package.
  654. Use this to add custom earcons.
  655. <P>
  656. <DD><DL>
  657. <DT><B>Parameters:</B><DD><CODE>earcon</CODE> - The name of the earcon. Example: <code>"[tick]"</code><br/><DD><CODE>packagename</CODE> - the package name of the application that contains the
  658. resource. This can for instance be the package name of your own
  659. application. Example: <b>"com.google.marvin.compass"</b><br/>
  660. The package name can be found in the AndroidManifest.xml of the
  661. application containing the resource.
  662. <p>
  663. <code>&lt;manifest xmlns:android=&quot;...&quot;
  664. package=&quot;<b>com.google.marvin.compass</b>&quot;&gt;</code>
  665. </p><DD><CODE>resourceId</CODE> - Example: <code>R.raw.tick_snd</code>
  666. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  667. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.<DT><B>See Also:</B><DD><A HREF="../../../com/google/tts/TextToSpeechBeta.html#playEarcon(java.lang.String, int, java.util.HashMap)"><CODE>playEarcon(String, int, HashMap)</CODE></A></DL>
  668. </DD>
  669. </DL>
  670. <HR>
  671. <A NAME="addEarcon(java.lang.String, java.lang.String)"><!-- --></A><H3>
  672. addEarcon</H3>
  673. <PRE>
  674. public int <B>addEarcon</B>(java.lang.String&nbsp;earcon,
  675. java.lang.String&nbsp;filename)</PRE>
  676. <DL>
  677. <DD>Adds a mapping between a string of text and a sound file. Use this to add
  678. custom earcons.
  679. <P>
  680. <DD><DL>
  681. <DT><B>Parameters:</B><DD><CODE>earcon</CODE> - The name of the earcon. Example: <code>"[tick]"</code><DD><CODE>filename</CODE> - The full path to the sound file (for example:
  682. "/sdcard/mysounds/tick.wav")
  683. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  684. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.<DT><B>See Also:</B><DD><A HREF="../../../com/google/tts/TextToSpeechBeta.html#playEarcon(java.lang.String, int, java.util.HashMap)"><CODE>playEarcon(String, int, HashMap)</CODE></A></DL>
  685. </DD>
  686. </DL>
  687. <HR>
  688. <A NAME="speak(java.lang.String, int, java.util.HashMap)"><!-- --></A><H3>
  689. speak</H3>
  690. <PRE>
  691. public int <B>speak</B>(java.lang.String&nbsp;text,
  692. int&nbsp;queueMode,
  693. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params)</PRE>
  694. <DL>
  695. <DD>Speaks the string using the specified queuing strategy and speech
  696. parameters.
  697. <P>
  698. <DD><DL>
  699. <DT><B>Parameters:</B><DD><CODE>text</CODE> - The string of text to be spoken.<DD><CODE>queueMode</CODE> - The queuing strategy to use. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_ADD"><CODE>QUEUE_ADD</CODE></A> or
  700. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_FLUSH"><CODE>QUEUE_FLUSH</CODE></A>.<DD><CODE>params</CODE> - The list of parameters to be used. Can be null if no
  701. parameters are given. They are specified using a (key, value) pair,
  702. where the key can be <A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html#KEY_PARAM_STREAM"><CODE>TextToSpeechBeta.Engine.KEY_PARAM_STREAM</CODE></A> or
  703. <A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html#KEY_PARAM_UTTERANCE_ID"><CODE>TextToSpeechBeta.Engine.KEY_PARAM_UTTERANCE_ID</CODE></A>.
  704. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  705. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  706. </DD>
  707. </DL>
  708. <HR>
  709. <A NAME="playEarcon(java.lang.String, int, java.util.HashMap)"><!-- --></A><H3>
  710. playEarcon</H3>
  711. <PRE>
  712. public int <B>playEarcon</B>(java.lang.String&nbsp;earcon,
  713. int&nbsp;queueMode,
  714. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params)</PRE>
  715. <DL>
  716. <DD>Plays the earcon using the specified queueing mode and parameters.
  717. <P>
  718. <DD><DL>
  719. <DT><B>Parameters:</B><DD><CODE>earcon</CODE> - The earcon that should be played<DD><CODE>queueMode</CODE> - <A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_ADD"><CODE>QUEUE_ADD</CODE></A> or <A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_FLUSH"><CODE>QUEUE_FLUSH</CODE></A>.<DD><CODE>params</CODE> - The list of parameters to be used. Can be null if no
  720. parameters are given. They are specified using a (key, value) pair,
  721. where the key can be <A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html#KEY_PARAM_STREAM"><CODE>TextToSpeechBeta.Engine.KEY_PARAM_STREAM</CODE></A> or
  722. <A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html#KEY_PARAM_UTTERANCE_ID"><CODE>TextToSpeechBeta.Engine.KEY_PARAM_UTTERANCE_ID</CODE></A>.
  723. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  724. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  725. </DD>
  726. </DL>
  727. <HR>
  728. <A NAME="playSilence(long, int, java.util.HashMap)"><!-- --></A><H3>
  729. playSilence</H3>
  730. <PRE>
  731. public int <B>playSilence</B>(long&nbsp;durationInMs,
  732. int&nbsp;queueMode,
  733. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params)</PRE>
  734. <DL>
  735. <DD>Plays silence for the specified amount of time using the specified queue
  736. mode.
  737. <P>
  738. <DD><DL>
  739. <DT><B>Parameters:</B><DD><CODE>durationInMs</CODE> - A long that indicates how long the silence should last.<DD><CODE>queueMode</CODE> - <A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_ADD"><CODE>QUEUE_ADD</CODE></A> or <A HREF="../../../com/google/tts/TextToSpeechBeta.html#QUEUE_FLUSH"><CODE>QUEUE_FLUSH</CODE></A>.<DD><CODE>params</CODE> - The list of parameters to be used. Can be null if no
  740. parameters are given. They are specified using a (key, value) pair,
  741. where the key can be <A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html#KEY_PARAM_UTTERANCE_ID"><CODE>TextToSpeechBeta.Engine.KEY_PARAM_UTTERANCE_ID</CODE></A>.
  742. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  743. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  744. </DD>
  745. </DL>
  746. <HR>
  747. <A NAME="isSpeaking()"><!-- --></A><H3>
  748. isSpeaking</H3>
  749. <PRE>
  750. public boolean <B>isSpeaking</B>()</PRE>
  751. <DL>
  752. <DD>Returns whether or not the TextToSpeech engine is busy speaking.
  753. <P>
  754. <DD><DL>
  755. <DT><B>Returns:</B><DD>Whether or not the TextToSpeech engine is busy speaking.</DL>
  756. </DD>
  757. </DL>
  758. <HR>
  759. <A NAME="stop()"><!-- --></A><H3>
  760. stop</H3>
  761. <PRE>
  762. public int <B>stop</B>()</PRE>
  763. <DL>
  764. <DD>Interrupts the current utterance (whether played or rendered to file) and
  765. discards other utterances in the queue.
  766. <P>
  767. <DD><DL>
  768. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  769. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  770. </DD>
  771. </DL>
  772. <HR>
  773. <A NAME="setSpeechRate(float)"><!-- --></A><H3>
  774. setSpeechRate</H3>
  775. <PRE>
  776. public int <B>setSpeechRate</B>(float&nbsp;speechRate)</PRE>
  777. <DL>
  778. <DD>Sets the speech rate for the TextToSpeech engine.
  779. This has no effect on any pre-recorded speech.
  780. <P>
  781. <DD><DL>
  782. <DT><B>Parameters:</B><DD><CODE>speechRate</CODE> - The speech rate for the TextToSpeech engine. 1 is the
  783. normal speed, lower values slow down the speech (0.5 is half the
  784. normal speech rate), greater values accelerate it (2 is twice the
  785. normal speech rate).
  786. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  787. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  788. </DD>
  789. </DL>
  790. <HR>
  791. <A NAME="setPitch(float)"><!-- --></A><H3>
  792. setPitch</H3>
  793. <PRE>
  794. public int <B>setPitch</B>(float&nbsp;pitch)</PRE>
  795. <DL>
  796. <DD>Sets the speech pitch for the TextToSpeech engine.
  797. This has no effect on any pre-recorded speech.
  798. <P>
  799. <DD><DL>
  800. <DT><B>Parameters:</B><DD><CODE>pitch</CODE> - The pitch for the TextToSpeech engine. 1 is the normal pitch,
  801. lower values lower the tone of the synthesized voice, greater values
  802. increase it.
  803. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  804. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  805. </DD>
  806. </DL>
  807. <HR>
  808. <A NAME="setLanguage(java.util.Locale)"><!-- --></A><H3>
  809. setLanguage</H3>
  810. <PRE>
  811. public int <B>setLanguage</B>(java.util.Locale&nbsp;loc)</PRE>
  812. <DL>
  813. <DD>Sets the language for the TextToSpeech engine. The TextToSpeech engine will
  814. try to use the closest match to the specified language as represented by
  815. the Locale, but there is no guarantee that the exact same Locale will be
  816. used. Use <A HREF="../../../com/google/tts/TextToSpeechBeta.html#isLanguageAvailable(java.util.Locale)"><CODE>isLanguageAvailable(Locale)</CODE></A> to check the level of
  817. support before choosing the language to use for the next utterances.
  818. <P>
  819. <DD><DL>
  820. <DT><B>Parameters:</B><DD><CODE>loc</CODE> - The locale describing the language to be used.
  821. <DT><B>Returns:</B><DD>code indicating the support status for the locale. See
  822. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_AVAILABLE"><CODE>LANG_AVAILABLE</CODE></A>, <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_COUNTRY_AVAILABLE"><CODE>LANG_COUNTRY_AVAILABLE</CODE></A>,
  823. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_COUNTRY_VAR_AVAILABLE"><CODE>LANG_COUNTRY_VAR_AVAILABLE</CODE></A>, <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_MISSING_DATA"><CODE>LANG_MISSING_DATA</CODE></A> and
  824. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_NOT_SUPPORTED"><CODE>LANG_NOT_SUPPORTED</CODE></A>.</DL>
  825. </DD>
  826. </DL>
  827. <HR>
  828. <A NAME="getLanguage()"><!-- --></A><H3>
  829. getLanguage</H3>
  830. <PRE>
  831. public java.util.Locale <B>getLanguage</B>()</PRE>
  832. <DL>
  833. <DD>Returns a Locale instance describing the language currently being used by
  834. the TextToSpeech engine.
  835. <P>
  836. <DD><DL>
  837. <DT><B>Returns:</B><DD>language, country (if any) and variant (if any) used by the engine
  838. stored in a Locale instance, or null is the TextToSpeech engine has
  839. failed.</DL>
  840. </DD>
  841. </DL>
  842. <HR>
  843. <A NAME="isLanguageAvailable(java.util.Locale)"><!-- --></A><H3>
  844. isLanguageAvailable</H3>
  845. <PRE>
  846. public int <B>isLanguageAvailable</B>(java.util.Locale&nbsp;loc)</PRE>
  847. <DL>
  848. <DD>Checks if the specified language as represented by the Locale is available
  849. and supported.
  850. <P>
  851. <DD><DL>
  852. <DT><B>Parameters:</B><DD><CODE>loc</CODE> - The Locale describing the language to be used.
  853. <DT><B>Returns:</B><DD>code indicating the support status for the locale. See
  854. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_AVAILABLE"><CODE>LANG_AVAILABLE</CODE></A>, <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_COUNTRY_AVAILABLE"><CODE>LANG_COUNTRY_AVAILABLE</CODE></A>,
  855. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_COUNTRY_VAR_AVAILABLE"><CODE>LANG_COUNTRY_VAR_AVAILABLE</CODE></A>, <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_MISSING_DATA"><CODE>LANG_MISSING_DATA</CODE></A> and
  856. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#LANG_NOT_SUPPORTED"><CODE>LANG_NOT_SUPPORTED</CODE></A>.</DL>
  857. </DD>
  858. </DL>
  859. <HR>
  860. <A NAME="synthesizeToFile(java.lang.String, java.util.HashMap, java.lang.String)"><!-- --></A><H3>
  861. synthesizeToFile</H3>
  862. <PRE>
  863. public int <B>synthesizeToFile</B>(java.lang.String&nbsp;text,
  864. java.util.HashMap&lt;java.lang.String,java.lang.String&gt;&nbsp;params,
  865. java.lang.String&nbsp;filename)</PRE>
  866. <DL>
  867. <DD>Synthesizes the given text to a file using the specified parameters.
  868. <P>
  869. <DD><DL>
  870. <DT><B>Parameters:</B><DD><CODE>text</CODE> - The String of text that should be synthesized<DD><CODE>params</CODE> - The list of parameters to be used. Can be null if no
  871. parameters are given. They are specified using a (key, value) pair,
  872. where the key can be <A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html#KEY_PARAM_UTTERANCE_ID"><CODE>TextToSpeechBeta.Engine.KEY_PARAM_UTTERANCE_ID</CODE></A>.<DD><CODE>filename</CODE> - The string that gives the full output filename; it should
  873. be something like "/sdcard/myappsounds/mysound.wav".
  874. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  875. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  876. </DD>
  877. </DL>
  878. <HR>
  879. <A NAME="setOnUtteranceCompletedListener(com.google.tts.TextToSpeechBeta.OnUtteranceCompletedListener)"><!-- --></A><H3>
  880. setOnUtteranceCompletedListener</H3>
  881. <PRE>
  882. public int <B>setOnUtteranceCompletedListener</B>(<A HREF="../../../com/google/tts/TextToSpeechBeta.OnUtteranceCompletedListener.html" title="interface in com.google.tts">TextToSpeechBeta.OnUtteranceCompletedListener</A>&nbsp;listener)</PRE>
  883. <DL>
  884. <DD>Sets the OnUtteranceCompletedListener that will fire when an utterance
  885. completes.
  886. <P>
  887. <DD><DL>
  888. <DT><B>Parameters:</B><DD><CODE>listener</CODE> - The OnUtteranceCompletedListener
  889. <DT><B>Returns:</B><DD>Code indicating success or failure. See <A HREF="../../../com/google/tts/TextToSpeechBeta.html#ERROR"><CODE>ERROR</CODE></A> and
  890. <A HREF="../../../com/google/tts/TextToSpeechBeta.html#SUCCESS"><CODE>SUCCESS</CODE></A>.</DL>
  891. </DD>
  892. </DL>
  893. <HR>
  894. <A NAME="isInstalled(Context)"><!-- --></A><H3>
  895. isInstalled</H3>
  896. <PRE>
  897. public static boolean <B>isInstalled</B>(Context&nbsp;ctx)</PRE>
  898. <DL>
  899. <DD>Standalone TTS ONLY!
  900. Checks if the TTS service is installed or not
  901. <P>
  902. <DD><DL>
  903. <DT><B>Returns:</B><DD>A boolean that indicates whether the TTS service is installed</DL>
  904. </DD>
  905. </DL>
  906. <!-- ========= END OF CLASS DATA ========= -->
  907. <HR>
  908. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  909. <A NAME="navbar_bottom"><!-- --></A>
  910. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  911. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  912. <TR>
  913. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  914. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  915. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  916. <TR ALIGN="center" VALIGN="top">
  917. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../com/google/tts/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  918. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  919. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  920. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  921. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  922. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  923. </TR>
  924. </TABLE>
  925. </TD>
  926. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  927. </EM>
  928. </TD>
  929. </TR>
  930. <TR>
  931. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  932. &nbsp;PREV CLASS&nbsp;
  933. &nbsp;<A HREF="../../../com/google/tts/TextToSpeechBeta.Engine.html" title="class in com.google.tts"><B>NEXT CLASS</B></A></FONT></TD>
  934. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  935. <A HREF="../../../index.html?com/google/tts/TextToSpeechBeta.html" target="_top"><B>FRAMES</B></A> &nbsp;
  936. &nbsp;<A HREF="TextToSpeechBeta.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  937. &nbsp;<SCRIPT type="text/javascript">
  938. <!--
  939. if(window==top) {
  940. document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  941. }
  942. //-->
  943. </SCRIPT>
  944. <NOSCRIPT>
  945. <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  946. </NOSCRIPT>
  947. </FONT></TD>
  948. </TR>
  949. <TR>
  950. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  951. SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  952. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  953. DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  954. </TR>
  955. </TABLE>
  956. <A NAME="skip-navbar_bottom"></A>
  957. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  958. <HR>
  959. </BODY>
  960. </HTML>