upstream version 1.2.2
[debian/freetts] / javadoc / com / sun / speech / freetts / audio / AudioPlayer.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\r
2 <!--NewPage-->\r
3 <HTML>\r
4 <HEAD>\r
5 <!-- Generated by javadoc (build 1.4.2_16) on Mon Mar 09 18:20:29 CET 2009 -->\r
6 <TITLE>\r
7 AudioPlayer (FreeTTS 1.2)\r
8 </TITLE>\r
9 \r
10 <META NAME="keywords" CONTENT="com.sun.speech.freetts.audio.AudioPlayer interface">\r
11 \r
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">\r
13 \r
14 <SCRIPT type="text/javascript">\r
15 function windowTitle()\r
16 {\r
17     parent.document.title="AudioPlayer (FreeTTS 1.2)";\r
18 }\r
19 </SCRIPT>\r
20 \r
21 </HEAD>\r
22 \r
23 <BODY BGCOLOR="white" onload="windowTitle();">\r
24 \r
25
26 <!-- ========= START OF TOP NAVBAR ======= -->\r
27 <A NAME="navbar_top"><!-- --></A>
28 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
29 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">\r
30 <TR>\r
31 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">\r
32 <A NAME="navbar_top_firstrow"><!-- --></A>
33 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">\r
34   <TR ALIGN="center" VALIGN="top">\r
35   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>\r
36   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>\r
37   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>\r
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>\r
39   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>\r
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>\r
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>\r
42   </TR>\r
43 </TABLE>\r
44 </TD>\r
45 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>\r
46 </EM>\r
47 </TD>\r
48 </TR>\r
49 \r
50 <TR>\r
51 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
52 &nbsp;PREV CLASS&nbsp;\r
53 &nbsp;NEXT CLASS</FONT></TD>\r
54 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
55   <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;\r
56 &nbsp;<A HREF="AudioPlayer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;\r
57 &nbsp;<SCRIPT type="text/javascript">\r
58   <!--\r
59   if(window==top) {\r
60     document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');\r
61   }\r
62   //-->\r
63 </SCRIPT>\r
64 <NOSCRIPT>\r
65   <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>\r
66 </NOSCRIPT>
67 \r
68 </FONT></TD>\r
69 </TR>\r
70 <TR>\r
71 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
72   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>\r
73 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
74 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>\r
75 </TR>\r
76 </TABLE>\r
77 <A NAME="skip-navbar_top"></A>
78 <!-- ========= END OF TOP NAVBAR ========= -->\r
79 \r
80 <HR>\r
81 <!-- ======== START OF CLASS DATA ======== -->\r
82 <H2>\r
83 <FONT SIZE="-1">\r
84 com.sun.speech.freetts.audio</FONT>\r
85 <BR>\r
86 Interface AudioPlayer</H2>\r
87 <DL>\r
88 <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html" title="class in com.sun.speech.freetts.audio">JavaClipAudioPlayer</A>, <A HREF="../../../../../com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.html" title="class in com.sun.speech.freetts.audio">JavaStreamingAudioPlayer</A>, <A HREF="../../../../../com/sun/speech/freetts/audio/MultiFile8BitAudioPlayer.html" title="class in com.sun.speech.freetts.audio">MultiFile8BitAudioPlayer</A>, <A HREF="../../../../../com/sun/speech/freetts/audio/MultiFileAudioPlayer.html" title="class in com.sun.speech.freetts.audio">MultiFileAudioPlayer</A>, <A HREF="../../../../../com/sun/speech/freetts/audio/NullAudioPlayer.html" title="class in com.sun.speech.freetts.audio">NullAudioPlayer</A>, <A HREF="../../../../../com/sun/speech/freetts/audio/RawFileAudioPlayer.html" title="class in com.sun.speech.freetts.audio">RawFileAudioPlayer</A>, <A HREF="../../../../../com/sun/speech/freetts/audio/SingleFileAudioPlayer.html" title="class in com.sun.speech.freetts.audio">SingleFileAudioPlayer</A></DD>\r
89 </DL>\r
90 <HR>\r
91 <DL>\r
92 <DT>public interface <B>AudioPlayer</B></DL>\r
93 \r
94 <P>\r
95 Provides an  interface to the audio system for use by freetts.
96   Audio is presented to the AudioPlayer as byte arrays.
97   Implementations of this AudioPlayer interface will format the data
98   based upon the current audio format (as set by
99   <code>setAudioFormat</code>) and output the data. 
100   
101   <p>
102   The AudioPlayer
103   interface provides a set of potential synchronization points to
104   allow a specific AudioPlayer to batch output in various ways.
105   <p>
106   These synchronization points are in pairs: <code>reset,
107   drain</code> are used to bracket output of large amounts of audio
108   data. Typically, an implementation will not return from
109   <code>drain</code> until all queued audio has been played (or
110   cancelled).
111   <p>
112   The methods: <code> begin, end</code> are used to bracket smaller amounts of
113   audio data (typically associated with a single utterance).
114
115   <h1>Threading Issues</h1>
116   Most of the methods in an AudioPlayer must be called from a
117   single thread. The only exceptions to this rule are <code> pause,
118   resume, cancel, showMetrics, close, getTime, resetTime</code>
119   which can be called from other threads.\r
120 <P>\r
121 \r
122 <P>\r
123 <HR>\r
124 \r
125 <P>\r
126 <!-- ======== NESTED CLASS SUMMARY ======== -->\r
127 \r
128 \r
129 <!-- =========== FIELD SUMMARY =========== -->\r
130 \r
131 \r
132 <!-- ======== CONSTRUCTOR SUMMARY ======== -->\r
133 \r
134 \r
135 <!-- ========== METHOD SUMMARY =========== -->\r
136 \r
137 <A NAME="method_summary"><!-- --></A>
138 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
139 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
140 <TD COLSPAN=2><FONT SIZE="+2">\r
141 <B>Method Summary</B></FONT></TD>\r
142 </TR>\r
143 <TR BGCOLOR="white" CLASS="TableRowColor">\r
144 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
145 <CODE>&nbsp;void</CODE></FONT></TD>\r
146 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#begin(int)">begin</A></B>(int&nbsp;size)</CODE>\r
147 \r
148 <BR>\r
149 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the output of a set of data. </TD>\r
150 </TR>\r
151 <TR BGCOLOR="white" CLASS="TableRowColor">\r
152 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
153 <CODE>&nbsp;void</CODE></FONT></TD>\r
154 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#cancel()">cancel</A></B>()</CODE>\r
155 \r
156 <BR>\r
157 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancels all queued output. </TD>\r
158 </TR>\r
159 <TR BGCOLOR="white" CLASS="TableRowColor">\r
160 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
161 <CODE>&nbsp;void</CODE></FONT></TD>\r
162 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#close()">close</A></B>()</CODE>\r
163 \r
164 <BR>\r
165 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Waits for all audio playback to stop, and closes this AudioPlayer.</TD>\r
166 </TR>\r
167 <TR BGCOLOR="white" CLASS="TableRowColor">\r
168 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
169 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
170 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#drain()">drain</A></B>()</CODE>\r
171 \r
172 <BR>\r
173 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Waits for all queued audio to be played</TD>\r
174 </TR>\r
175 <TR BGCOLOR="white" CLASS="TableRowColor">\r
176 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
177 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
178 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#end()">end</A></B>()</CODE>\r
179 \r
180 <BR>\r
181 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Signals the end of a set of data. </TD>\r
182 </TR>\r
183 <TR BGCOLOR="white" CLASS="TableRowColor">\r
184 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
185 <CODE>&nbsp;javax.sound.sampled.AudioFormat</CODE></FONT></TD>\r
186 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#getAudioFormat()">getAudioFormat</A></B>()</CODE>\r
187 \r
188 <BR>\r
189 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the audio format for this player</TD>\r
190 </TR>\r
191 <TR BGCOLOR="white" CLASS="TableRowColor">\r
192 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
193 <CODE>&nbsp;long</CODE></FONT></TD>\r
194 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#getTime()">getTime</A></B>()</CODE>\r
195 \r
196 <BR>\r
197 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the amount of audio played since the last resetTime</TD>\r
198 </TR>\r
199 <TR BGCOLOR="white" CLASS="TableRowColor">\r
200 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
201 <CODE>&nbsp;float</CODE></FONT></TD>\r
202 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#getVolume()">getVolume</A></B>()</CODE>\r
203 \r
204 <BR>\r
205 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current volume. </TD>\r
206 </TR>\r
207 <TR BGCOLOR="white" CLASS="TableRowColor">\r
208 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
209 <CODE>&nbsp;void</CODE></FONT></TD>\r
210 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#pause()">pause</A></B>()</CODE>\r
211 \r
212 <BR>\r
213 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pauses all audio output on this player. </TD>\r
214 </TR>\r
215 <TR BGCOLOR="white" CLASS="TableRowColor">\r
216 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
217 <CODE>&nbsp;void</CODE></FONT></TD>\r
218 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#reset()">reset</A></B>()</CODE>\r
219 \r
220 <BR>\r
221 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prepares for another batch of output. </TD>\r
222 </TR>\r
223 <TR BGCOLOR="white" CLASS="TableRowColor">\r
224 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
225 <CODE>&nbsp;void</CODE></FONT></TD>\r
226 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#resetTime()">resetTime</A></B>()</CODE>\r
227 \r
228 <BR>\r
229 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets the audio clock</TD>\r
230 </TR>\r
231 <TR BGCOLOR="white" CLASS="TableRowColor">\r
232 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
233 <CODE>&nbsp;void</CODE></FONT></TD>\r
234 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#resume()">resume</A></B>()</CODE>\r
235 \r
236 <BR>\r
237 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resumes audio output on this player</TD>\r
238 </TR>\r
239 <TR BGCOLOR="white" CLASS="TableRowColor">\r
240 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
241 <CODE>&nbsp;void</CODE></FONT></TD>\r
242 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#setAudioFormat(javax.sound.sampled.AudioFormat)">setAudioFormat</A></B>(javax.sound.sampled.AudioFormat&nbsp;format)</CODE>\r
243 \r
244 <BR>\r
245 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the audio format to use for the next set of outputs. </TD>\r
246 </TR>\r
247 <TR BGCOLOR="white" CLASS="TableRowColor">\r
248 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
249 <CODE>&nbsp;void</CODE></FONT></TD>\r
250 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#setVolume(float)">setVolume</A></B>(float&nbsp;volume)</CODE>\r
251 \r
252 <BR>\r
253 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the current volume. </TD>\r
254 </TR>\r
255 <TR BGCOLOR="white" CLASS="TableRowColor">\r
256 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
257 <CODE>&nbsp;void</CODE></FONT></TD>\r
258 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#showMetrics()">showMetrics</A></B>()</CODE>\r
259 \r
260 <BR>\r
261 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shows metrics for this audio player</TD>\r
262 </TR>\r
263 <TR BGCOLOR="white" CLASS="TableRowColor">\r
264 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
265 <CODE>&nbsp;void</CODE></FONT></TD>\r
266 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#startFirstSampleTimer()">startFirstSampleTimer</A></B>()</CODE>\r
267 \r
268 <BR>\r
269 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the first sample timer</TD>\r
270 </TR>\r
271 <TR BGCOLOR="white" CLASS="TableRowColor">\r
272 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
273 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
274 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#write(byte[])">write</A></B>(byte[]&nbsp;audioData)</CODE>\r
275 \r
276 <BR>\r
277 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the given bytes to the audio stream</TD>\r
278 </TR>\r
279 <TR BGCOLOR="white" CLASS="TableRowColor">\r
280 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
281 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
282 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#write(byte[], int, int)">write</A></B>(byte[]&nbsp;audioData,
283       int&nbsp;offset,
284       int&nbsp;size)</CODE>\r
285 \r
286 <BR>\r
287 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the given bytes to the audio stream</TD>\r
288 </TR>\r
289 </TABLE>\r
290 &nbsp;\r
291 <P>\r
292 \r
293 <!-- ============ FIELD DETAIL =========== -->\r
294 \r
295 \r
296 <!-- ========= CONSTRUCTOR DETAIL ======== -->\r
297 \r
298 \r
299 <!-- ============ METHOD DETAIL ========== -->\r
300 \r
301 <A NAME="method_detail"><!-- --></A>
302 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
303 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
304 <TD COLSPAN=1><FONT SIZE="+2">\r
305 <B>Method Detail</B></FONT></TD>\r
306 </TR>\r
307 </TABLE>\r
308 \r
309 <A NAME="setAudioFormat(javax.sound.sampled.AudioFormat)"><!-- --></A><H3>\r
310 setAudioFormat</H3>\r
311 <PRE>\r
312 public void <B>setAudioFormat</B>(javax.sound.sampled.AudioFormat&nbsp;format)</PRE>\r
313 <DL>\r
314 <DD>Sets the audio format to use for the next set of outputs. Since
315  an audio player can be shared by a number of voices, and since
316  voices can have different AudioFormats (sample rates for
317  example), it is necessary to allow clients to dynamically set
318  the audio format for the player.\r
319 <P>\r
320 <DD><DL>\r
321 <DT><B>Parameters:</B><DD><CODE>format</CODE> - the audio format</DL>\r
322 </DD>\r
323 </DL>\r
324 <HR>\r
325 \r
326 <A NAME="getAudioFormat()"><!-- --></A><H3>\r
327 getAudioFormat</H3>\r
328 <PRE>\r
329 public javax.sound.sampled.AudioFormat <B>getAudioFormat</B>()</PRE>\r
330 <DL>\r
331 <DD>Retrieves the audio format for this player\r
332 <P>\r
333 <DD><DL>\r
334
335 <DT><B>Returns:</B><DD>the current audio format</DL>\r
336 </DD>\r
337 </DL>\r
338 <HR>\r
339 \r
340 <A NAME="pause()"><!-- --></A><H3>\r
341 pause</H3>\r
342 <PRE>\r
343 public void <B>pause</B>()</PRE>\r
344 <DL>\r
345 <DD>Pauses all audio output on this player. Play can be resumed
346  with a call to resume\r
347 <P>\r
348 <DD><DL>\r
349 </DL>\r
350 </DD>\r
351 </DL>\r
352 <HR>\r
353 \r
354 <A NAME="resume()"><!-- --></A><H3>\r
355 resume</H3>\r
356 <PRE>\r
357 public void <B>resume</B>()</PRE>\r
358 <DL>\r
359 <DD>Resumes audio output on this player\r
360 <P>\r
361 <DD><DL>\r
362 </DL>\r
363 </DD>\r
364 </DL>\r
365 <HR>\r
366 \r
367 <A NAME="reset()"><!-- --></A><H3>\r
368 reset</H3>\r
369 <PRE>\r
370 public void <B>reset</B>()</PRE>\r
371 <DL>\r
372 <DD>Prepares for another batch of output. Larger groups of output
373  (such as all output associated with a single FreeTTSSpeakable)
374  should be grouped between a reset/drain pair.\r
375 <P>\r
376 <DD><DL>\r
377 </DL>\r
378 </DD>\r
379 </DL>\r
380 <HR>\r
381 \r
382 <A NAME="drain()"><!-- --></A><H3>\r
383 drain</H3>\r
384 <PRE>\r
385 public boolean <B>drain</B>()</PRE>\r
386 <DL>\r
387 <DD>Waits for all queued audio to be played\r
388 <P>\r
389 <DD><DL>\r
390
391 <DT><B>Returns:</B><DD><code>true</code> if the audio played to completion;
392      otherwise <code> false </code> if the audio was stopped</DL>\r
393 </DD>\r
394 </DL>\r
395 <HR>\r
396 \r
397 <A NAME="begin(int)"><!-- --></A><H3>\r
398 begin</H3>\r
399 <PRE>\r
400 public void <B>begin</B>(int&nbsp;size)</PRE>\r
401 <DL>\r
402 <DD>Starts the output of a set of data. Audio data for a single
403   utterance should be grouped between begin/end pairs.\r
404 <P>\r
405 <DD><DL>\r
406 <DT><B>Parameters:</B><DD><CODE>size</CODE> - the size of data in bytes to be output before
407     <code>end</code> is called.</DL>\r
408 </DD>\r
409 </DL>\r
410 <HR>\r
411 \r
412 <A NAME="end()"><!-- --></A><H3>\r
413 end</H3>\r
414 <PRE>\r
415 public boolean <B>end</B>()</PRE>\r
416 <DL>\r
417 <DD>Signals the end of a set of data. Audio data for a single 
418   utterance should be groupd between <code> begin/end </code> pairs.\r
419 <P>\r
420 <DD><DL>\r
421
422 <DT><B>Returns:</B><DD><code>true</code> if the audio was output properly, 
423                 <code> false</code> if the output was canceled 
424                 or interrupted.</DL>\r
425 </DD>\r
426 </DL>\r
427 <HR>\r
428 \r
429 <A NAME="cancel()"><!-- --></A><H3>\r
430 cancel</H3>\r
431 <PRE>\r
432 public void <B>cancel</B>()</PRE>\r
433 <DL>\r
434 <DD>Cancels all queued output. All 'write' calls until the next
435  reset will return false.\r
436 <P>\r
437 <DD><DL>\r
438 </DL>\r
439 </DD>\r
440 </DL>\r
441 <HR>\r
442 \r
443 <A NAME="close()"><!-- --></A><H3>\r
444 close</H3>\r
445 <PRE>\r
446 public void <B>close</B>()</PRE>\r
447 <DL>\r
448 <DD>Waits for all audio playback to stop, and closes this AudioPlayer.\r
449 <P>\r
450 <DD><DL>\r
451 </DL>\r
452 </DD>\r
453 </DL>\r
454 <HR>\r
455 \r
456 <A NAME="getVolume()"><!-- --></A><H3>\r
457 getVolume</H3>\r
458 <PRE>\r
459 public float <B>getVolume</B>()</PRE>\r
460 <DL>\r
461 <DD>Returns the current volume. The volume is specified as a number
462  between 0.0 and 1.0, where 1.0 is the maximum volume and 0.0 is
463  the minimum volume.\r
464 <P>\r
465 <DD><DL>\r
466
467 <DT><B>Returns:</B><DD>the current volume (between 0 and 1)</DL>\r
468 </DD>\r
469 </DL>\r
470 <HR>\r
471 \r
472 <A NAME="setVolume(float)"><!-- --></A><H3>\r
473 setVolume</H3>\r
474 <PRE>\r
475 public void <B>setVolume</B>(float&nbsp;volume)</PRE>\r
476 <DL>\r
477 <DD>Sets the current volume. The volume is specified as a number
478  between 0.0 and 1.0, where 1.0 is the maximum volume and 0.0 is
479  the minimum volume.\r
480 <P>\r
481 <DD><DL>\r
482 <DT><B>Parameters:</B><DD><CODE>volume</CODE> - the new volume (between 0 and 1)</DL>\r
483 </DD>\r
484 </DL>\r
485 <HR>\r
486 \r
487 <A NAME="getTime()"><!-- --></A><H3>\r
488 getTime</H3>\r
489 <PRE>\r
490 public long <B>getTime</B>()</PRE>\r
491 <DL>\r
492 <DD>Gets the amount of audio played since the last resetTime\r
493 <P>\r
494 <DD><DL>\r
495
496 <DT><B>Returns:</B><DD>the amount of audio in milliseconds</DL>\r
497 </DD>\r
498 </DL>\r
499 <HR>\r
500 \r
501 <A NAME="resetTime()"><!-- --></A><H3>\r
502 resetTime</H3>\r
503 <PRE>\r
504 public void <B>resetTime</B>()</PRE>\r
505 <DL>\r
506 <DD>Resets the audio clock\r
507 <P>\r
508 <DD><DL>\r
509 </DL>\r
510 </DD>\r
511 </DL>\r
512 <HR>\r
513 \r
514 <A NAME="startFirstSampleTimer()"><!-- --></A><H3>\r
515 startFirstSampleTimer</H3>\r
516 <PRE>\r
517 public void <B>startFirstSampleTimer</B>()</PRE>\r
518 <DL>\r
519 <DD>Starts the first sample timer\r
520 <P>\r
521 <DD><DL>\r
522 </DL>\r
523 </DD>\r
524 </DL>\r
525 <HR>\r
526 \r
527 <A NAME="write(byte[])"><!-- --></A><H3>\r
528 write</H3>\r
529 <PRE>\r
530 public boolean <B>write</B>(byte[]&nbsp;audioData)</PRE>\r
531 <DL>\r
532 <DD>Writes the given bytes to the audio stream\r
533 <P>\r
534 <DD><DL>\r
535 <DT><B>Parameters:</B><DD><CODE>audioData</CODE> - audio data to write to the device
536 <DT><B>Returns:</B><DD><code>true</code> of the write completed successfully, 
537         <code> false </code>if the write was cancelled.</DL>\r
538 </DD>\r
539 </DL>\r
540 <HR>\r
541 \r
542 <A NAME="write(byte[], int, int)"><!-- --></A><H3>\r
543 write</H3>\r
544 <PRE>\r
545 public boolean <B>write</B>(byte[]&nbsp;audioData,
546                      int&nbsp;offset,
547                      int&nbsp;size)</PRE>\r
548 <DL>\r
549 <DD>Writes the given bytes to the audio stream\r
550 <P>\r
551 <DD><DL>\r
552 <DT><B>Parameters:</B><DD><CODE>audioData</CODE> - audio data to write to the device<DD><CODE>offset</CODE> - the offset into the buffer<DD><CODE>size</CODE> - the number of bytes to write.
553 <DT><B>Returns:</B><DD><code>true</code> of the write completed successfully, 
554         <code> false </code>if the write was cancelled.</DL>\r
555 </DD>\r
556 </DL>\r
557 <HR>\r
558 \r
559 <A NAME="showMetrics()"><!-- --></A><H3>\r
560 showMetrics</H3>\r
561 <PRE>\r
562 public void <B>showMetrics</B>()</PRE>\r
563 <DL>\r
564 <DD>Shows metrics for this audio player\r
565 <P>\r
566 <DD><DL>\r
567 </DL>\r
568 </DD>\r
569 </DL>\r
570 <!-- ========= END OF CLASS DATA ========= -->\r
571 <HR>\r
572 \r
573
574 <!-- ======= START OF BOTTOM NAVBAR ====== -->\r
575 <A NAME="navbar_bottom"><!-- --></A>
576 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
577 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">\r
578 <TR>\r
579 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">\r
580 <A NAME="navbar_bottom_firstrow"><!-- --></A>
581 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">\r
582   <TR ALIGN="center" VALIGN="top">\r
583   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>\r
584   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>\r
585   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>\r
586   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>\r
587   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>\r
588   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>\r
589   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>\r
590   </TR>\r
591 </TABLE>\r
592 </TD>\r
593 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>\r
594 </EM>\r
595 </TD>\r
596 </TR>\r
597 \r
598 <TR>\r
599 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
600 &nbsp;PREV CLASS&nbsp;\r
601 &nbsp;NEXT CLASS</FONT></TD>\r
602 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
603   <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;\r
604 &nbsp;<A HREF="AudioPlayer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;\r
605 &nbsp;<SCRIPT type="text/javascript">\r
606   <!--\r
607   if(window==top) {\r
608     document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');\r
609   }\r
610   //-->\r
611 </SCRIPT>\r
612 <NOSCRIPT>\r
613   <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>\r
614 </NOSCRIPT>
615 \r
616 </FONT></TD>\r
617 </TR>\r
618 <TR>\r
619 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
620   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>\r
621 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
622 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>\r
623 </TR>\r
624 </TABLE>\r
625 <A NAME="skip-navbar_bottom"></A>
626 <!-- ======== END OF BOTTOM NAVBAR ======= -->\r
627 \r
628 <HR>\r
629 \r
630 </BODY>\r
631 </HTML>\r