upstream version 1.2.2
[debian/freetts] / javadoc / com / sun / speech / freetts / audio / JavaClipAudioPlayer.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 JavaClipAudioPlayer (FreeTTS 1.2)\r
8 </TITLE>\r
9 \r
10 <META NAME="keywords" CONTENT="com.sun.speech.freetts.audio.JavaClipAudioPlayer class">\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="JavaClipAudioPlayer (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;<A HREF="../../../../../com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.html" title="class in com.sun.speech.freetts.audio"><B>NEXT CLASS</B></A></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="JavaClipAudioPlayer.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;<A HREF="#constructor_summary">CONSTR</A>&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;<A HREF="#constructor_detail">CONSTR</A>&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 Class JavaClipAudioPlayer</H2>\r
87 <PRE>\r
88 java.lang.Object\r
89   <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>com.sun.speech.freetts.audio.JavaClipAudioPlayer</B>\r
90 </PRE>\r
91 <DL>\r
92 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></DD>\r
93 </DL>\r
94 <HR>\r
95 <DL>\r
96 <DT>public class <B>JavaClipAudioPlayer</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></DL>\r
97 \r
98 <P>\r
99 Provides an implementation of <code>AudioPlayer</code> that creates
100  javax.sound.sampled audio clips and outputs them via the
101  javax.sound API.  The interface provides a highly reliable audio
102  output package. Since audio is batched and not sent to the audio
103  layer until an entire utterance has been processed, this player has
104  higher latency (50 msecs for a typical 4 second utterance).\r
105 <P>\r
106 \r
107 <P>\r
108 <HR>\r
109 \r
110 <P>\r
111 <!-- ======== NESTED CLASS SUMMARY ======== -->\r
112 \r
113 \r
114 <!-- =========== FIELD SUMMARY =========== -->\r
115 \r
116 \r
117 <!-- ======== CONSTRUCTOR SUMMARY ======== -->\r
118 \r
119 <A NAME="constructor_summary"><!-- --></A>
120 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
121 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
122 <TD COLSPAN=2><FONT SIZE="+2">\r
123 <B>Constructor Summary</B></FONT></TD>\r
124 </TR>\r
125 <TR BGCOLOR="white" CLASS="TableRowColor">\r
126 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#JavaClipAudioPlayer()">JavaClipAudioPlayer</A></B>()</CODE>\r
127 \r
128 <BR>\r
129 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a default JavaClipAudioPlayer</TD>\r
130 </TR>\r
131 </TABLE>\r
132 &nbsp;\r
133 <!-- ========== METHOD SUMMARY =========== -->\r
134 \r
135 <A NAME="method_summary"><!-- --></A>
136 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
137 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
138 <TD COLSPAN=2><FONT SIZE="+2">\r
139 <B>Method Summary</B></FONT></TD>\r
140 </TR>\r
141 <TR BGCOLOR="white" CLASS="TableRowColor">\r
142 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
143 <CODE>&nbsp;void</CODE></FONT></TD>\r
144 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#begin(int)">begin</A></B>(int&nbsp;size)</CODE>\r
145 \r
146 <BR>\r
147 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the output of a set of data. </TD>\r
148 </TR>\r
149 <TR BGCOLOR="white" CLASS="TableRowColor">\r
150 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
151 <CODE>&nbsp;void</CODE></FONT></TD>\r
152 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#cancel()">cancel</A></B>()</CODE>\r
153 \r
154 <BR>\r
155 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cancels all queued audio. </TD>\r
156 </TR>\r
157 <TR BGCOLOR="white" CLASS="TableRowColor">\r
158 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
159 <CODE>&nbsp;void</CODE></FONT></TD>\r
160 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#close()">close</A></B>()</CODE>\r
161 \r
162 <BR>\r
163 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes this audio player
164
165         [[[ WORKAROUND TODO
166    The javax.sound.sampled drain is almost working properly.  </TD>\r
167 </TR>\r
168 <TR BGCOLOR="white" CLASS="TableRowColor">\r
169 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
170 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
171 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#drain()">drain</A></B>()</CODE>\r
172 \r
173 <BR>\r
174 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Waits for all queued audio to be played</TD>\r
175 </TR>\r
176 <TR BGCOLOR="white" CLASS="TableRowColor">\r
177 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
178 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
179 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#end()">end</A></B>()</CODE>\r
180 \r
181 <BR>\r
182 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marks the end a set of data. </TD>\r
183 </TR>\r
184 <TR BGCOLOR="white" CLASS="TableRowColor">\r
185 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
186 <CODE>&nbsp;javax.sound.sampled.AudioFormat</CODE></FONT></TD>\r
187 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#getAudioFormat()">getAudioFormat</A></B>()</CODE>\r
188 \r
189 <BR>\r
190 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the audio format for this player</TD>\r
191 </TR>\r
192 <TR BGCOLOR="white" CLASS="TableRowColor">\r
193 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
194 <CODE>&nbsp;long</CODE></FONT></TD>\r
195 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#getTime()">getTime</A></B>()</CODE>\r
196 \r
197 <BR>\r
198 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current position in the output stream since the
199  last <code>resetTime</code> 
200
201  Currently not supported.</TD>\r
202 </TR>\r
203 <TR BGCOLOR="white" CLASS="TableRowColor">\r
204 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
205 <CODE>&nbsp;float</CODE></FONT></TD>\r
206 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#getVolume()">getVolume</A></B>()</CODE>\r
207 \r
208 <BR>\r
209 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current volume.</TD>\r
210 </TR>\r
211 <TR BGCOLOR="white" CLASS="TableRowColor">\r
212 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
213 <CODE>&nbsp;void</CODE></FONT></TD>\r
214 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#pause()">pause</A></B>()</CODE>\r
215 \r
216 <BR>\r
217 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pauses audio output.   </TD>\r
218 </TR>\r
219 <TR BGCOLOR="white" CLASS="TableRowColor">\r
220 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
221 <CODE>&nbsp;void</CODE></FONT></TD>\r
222 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#reset()">reset</A></B>()</CODE>\r
223 \r
224 <BR>\r
225 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prepares for another batch of output. </TD>\r
226 </TR>\r
227 <TR BGCOLOR="white" CLASS="TableRowColor">\r
228 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
229 <CODE>&nbsp;void</CODE></FONT></TD>\r
230 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#resetTime()">resetTime</A></B>()</CODE>\r
231 \r
232 <BR>\r
233 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets the time for this audio stream to zero</TD>\r
234 </TR>\r
235 <TR BGCOLOR="white" CLASS="TableRowColor">\r
236 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
237 <CODE>&nbsp;void</CODE></FONT></TD>\r
238 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#resume()">resume</A></B>()</CODE>\r
239 \r
240 <BR>\r
241 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resumes playing audio after a pause.</TD>\r
242 </TR>\r
243 <TR BGCOLOR="white" CLASS="TableRowColor">\r
244 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
245 <CODE>&nbsp;void</CODE></FONT></TD>\r
246 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#setAudioFormat(javax.sound.sampled.AudioFormat)">setAudioFormat</A></B>(javax.sound.sampled.AudioFormat&nbsp;format)</CODE>\r
247 \r
248 <BR>\r
249 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the audio format for this player</TD>\r
250 </TR>\r
251 <TR BGCOLOR="white" CLASS="TableRowColor">\r
252 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
253 <CODE>&nbsp;void</CODE></FONT></TD>\r
254 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#setVolume(float)">setVolume</A></B>(float&nbsp;volume)</CODE>\r
255 \r
256 <BR>\r
257 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the current volume.</TD>\r
258 </TR>\r
259 <TR BGCOLOR="white" CLASS="TableRowColor">\r
260 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
261 <CODE>&nbsp;void</CODE></FONT></TD>\r
262 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#showMetrics()">showMetrics</A></B>()</CODE>\r
263 \r
264 <BR>\r
265 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shows metrics for this audio player</TD>\r
266 </TR>\r
267 <TR BGCOLOR="white" CLASS="TableRowColor">\r
268 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
269 <CODE>&nbsp;void</CODE></FONT></TD>\r
270 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#startFirstSampleTimer()">startFirstSampleTimer</A></B>()</CODE>\r
271 \r
272 <BR>\r
273 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the first sample timer</TD>\r
274 </TR>\r
275 <TR BGCOLOR="white" CLASS="TableRowColor">\r
276 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
277 <CODE>&nbsp;java.lang.String</CODE></FONT></TD>\r
278 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#toString()">toString</A></B>()</CODE>\r
279 \r
280 <BR>\r
281 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of this audio player</TD>\r
282 </TR>\r
283 <TR BGCOLOR="white" CLASS="TableRowColor">\r
284 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
285 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
286 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#write(byte[])">write</A></B>(byte[]&nbsp;audioData)</CODE>\r
287 \r
288 <BR>\r
289 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the given bytes to the audio stream</TD>\r
290 </TR>\r
291 <TR BGCOLOR="white" CLASS="TableRowColor">\r
292 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">\r
293 <CODE>&nbsp;boolean</CODE></FONT></TD>\r
294 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/audio/JavaClipAudioPlayer.html#write(byte[], int, int)">write</A></B>(byte[]&nbsp;bytes,
295       int&nbsp;offset,
296       int&nbsp;size)</CODE>\r
297 \r
298 <BR>\r
299 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the given bytes to the audio stream</TD>\r
300 </TR>\r
301 </TABLE>\r
302 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
303 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
304 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">\r
305 <TD><B>Methods inherited from class java.lang.Object</B></TD>\r
306 </TR>\r
307 <TR BGCOLOR="white" CLASS="TableRowColor">\r
308 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>\r
309 </TR>\r
310 </TABLE>\r
311 &nbsp;\r
312 <P>\r
313 \r
314 <!-- ============ FIELD DETAIL =========== -->\r
315 \r
316 \r
317 <!-- ========= CONSTRUCTOR DETAIL ======== -->\r
318 \r
319 <A NAME="constructor_detail"><!-- --></A>
320 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
321 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
322 <TD COLSPAN=1><FONT SIZE="+2">\r
323 <B>Constructor Detail</B></FONT></TD>\r
324 </TR>\r
325 </TABLE>\r
326 \r
327 <A NAME="JavaClipAudioPlayer()"><!-- --></A><H3>\r
328 JavaClipAudioPlayer</H3>\r
329 <PRE>\r
330 public <B>JavaClipAudioPlayer</B>()</PRE>\r
331 <DL>\r
332 <DD>Constructs a default JavaClipAudioPlayer\r
333 <P>\r
334 </DL>\r
335 \r
336 <!-- ============ METHOD DETAIL ========== -->\r
337 \r
338 <A NAME="method_detail"><!-- --></A>
339 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">\r
340 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">\r
341 <TD COLSPAN=1><FONT SIZE="+2">\r
342 <B>Method Detail</B></FONT></TD>\r
343 </TR>\r
344 </TABLE>\r
345 \r
346 <A NAME="setAudioFormat(javax.sound.sampled.AudioFormat)"><!-- --></A><H3>\r
347 setAudioFormat</H3>\r
348 <PRE>\r
349 public void <B>setAudioFormat</B>(javax.sound.sampled.AudioFormat&nbsp;format)</PRE>\r
350 <DL>\r
351 <DD>Sets the audio format for this player\r
352 <P>\r
353 <DD><DL>\r
354 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#setAudioFormat(javax.sound.sampled.AudioFormat)">setAudioFormat</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
355 </DD>\r
356 <DD><DL>\r
357 <DT><B>Parameters:</B><DD><CODE>format</CODE> - the audio format
358 <DT><B>Throws:</B>
359 <DD><CODE>java.lang.UnsupportedOperationException</CODE> - if the line cannot be opened with
360      the given format</DL>\r
361 </DD>\r
362 </DL>\r
363 <HR>\r
364 \r
365 <A NAME="getAudioFormat()"><!-- --></A><H3>\r
366 getAudioFormat</H3>\r
367 <PRE>\r
368 public javax.sound.sampled.AudioFormat <B>getAudioFormat</B>()</PRE>\r
369 <DL>\r
370 <DD>Retrieves the audio format for this player\r
371 <P>\r
372 <DD><DL>\r
373 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#getAudioFormat()">getAudioFormat</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
374 </DD>\r
375 <DD><DL>\r
376
377 <DT><B>Returns:</B><DD>format the audio format</DL>\r
378 </DD>\r
379 </DL>\r
380 <HR>\r
381 \r
382 <A NAME="pause()"><!-- --></A><H3>\r
383 pause</H3>\r
384 <PRE>\r
385 public void <B>pause</B>()</PRE>\r
386 <DL>\r
387 <DD>Pauses audio output.   All audio output is 
388  stopped. Output can be resumed at the
389  current point by calling <code>resume</code>. Output can be
390  aborted by calling <code> cancel </code>\r
391 <P>\r
392 <DD><DL>\r
393 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#pause()">pause</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
394 </DD>\r
395 <DD><DL>\r
396 </DL>\r
397 </DD>\r
398 </DL>\r
399 <HR>\r
400 \r
401 <A NAME="resume()"><!-- --></A><H3>\r
402 resume</H3>\r
403 <PRE>\r
404 public void <B>resume</B>()</PRE>\r
405 <DL>\r
406 <DD>Resumes playing audio after a pause.\r
407 <P>\r
408 <DD><DL>\r
409 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#resume()">resume</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
410 </DD>\r
411 <DD><DL>\r
412 </DL>\r
413 </DD>\r
414 </DL>\r
415 <HR>\r
416 \r
417 <A NAME="cancel()"><!-- --></A><H3>\r
418 cancel</H3>\r
419 <PRE>\r
420 public void <B>cancel</B>()</PRE>\r
421 <DL>\r
422 <DD>Cancels all queued audio. Any 'write' in process will return
423  immediately false.\r
424 <P>\r
425 <DD><DL>\r
426 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#cancel()">cancel</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
427 </DD>\r
428 <DD><DL>\r
429 </DL>\r
430 </DD>\r
431 </DL>\r
432 <HR>\r
433 \r
434 <A NAME="reset()"><!-- --></A><H3>\r
435 reset</H3>\r
436 <PRE>\r
437 public void <B>reset</B>()</PRE>\r
438 <DL>\r
439 <DD>Prepares for another batch of output. Larger groups of output
440  (such as all output associated with a single FreeTTSSpeakable)
441  should be grouped between a reset/drain pair.\r
442 <P>\r
443 <DD><DL>\r
444 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#reset()">reset</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
445 </DD>\r
446 <DD><DL>\r
447 </DL>\r
448 </DD>\r
449 </DL>\r
450 <HR>\r
451 \r
452 <A NAME="drain()"><!-- --></A><H3>\r
453 drain</H3>\r
454 <PRE>\r
455 public boolean <B>drain</B>()</PRE>\r
456 <DL>\r
457 <DD>Waits for all queued audio to be played\r
458 <P>\r
459 <DD><DL>\r
460 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#drain()">drain</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
461 </DD>\r
462 <DD><DL>\r
463
464 <DT><B>Returns:</B><DD><code>true</code> if the write completed successfully, 
465         <code> false </code>if the write was cancelled.</DL>\r
466 </DD>\r
467 </DL>\r
468 <HR>\r
469 \r
470 <A NAME="close()"><!-- --></A><H3>\r
471 close</H3>\r
472 <PRE>\r
473 public void <B>close</B>()</PRE>\r
474 <DL>\r
475 <DD>Closes this audio player
476
477         [[[ WORKAROUND TODO
478    The javax.sound.sampled drain is almost working properly.  On
479    linux, there is still a little bit of sound that needs to go
480    out, even after drain is called. Thus, the drainDelay. We
481    wait for a few hundred milliseconds while the data is really
482    drained out of the system
483  ]]]\r
484 <P>\r
485 <DD><DL>\r
486 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#close()">close</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
487 </DD>\r
488 <DD><DL>\r
489 </DL>\r
490 </DD>\r
491 </DL>\r
492 <HR>\r
493 \r
494 <A NAME="getVolume()"><!-- --></A><H3>\r
495 getVolume</H3>\r
496 <PRE>\r
497 public float <B>getVolume</B>()</PRE>\r
498 <DL>\r
499 <DD>Returns the current volume.\r
500 <P>\r
501 <DD><DL>\r
502 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#getVolume()">getVolume</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
503 </DD>\r
504 <DD><DL>\r
505
506 <DT><B>Returns:</B><DD>the current volume (between 0 and 1)</DL>\r
507 </DD>\r
508 </DL>\r
509 <HR>\r
510 \r
511 <A NAME="setVolume(float)"><!-- --></A><H3>\r
512 setVolume</H3>\r
513 <PRE>\r
514 public void <B>setVolume</B>(float&nbsp;volume)</PRE>\r
515 <DL>\r
516 <DD>Sets the current volume.\r
517 <P>\r
518 <DD><DL>\r
519 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#setVolume(float)">setVolume</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
520 </DD>\r
521 <DD><DL>\r
522 <DT><B>Parameters:</B><DD><CODE>volume</CODE> - the current volume (between 0 and 1)</DL>\r
523 </DD>\r
524 </DL>\r
525 <HR>\r
526 \r
527 <A NAME="getTime()"><!-- --></A><H3>\r
528 getTime</H3>\r
529 <PRE>\r
530 public long <B>getTime</B>()</PRE>\r
531 <DL>\r
532 <DD>Returns the current position in the output stream since the
533  last <code>resetTime</code> 
534
535  Currently not supported.\r
536 <P>\r
537 <DD><DL>\r
538 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#getTime()">getTime</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
539 </DD>\r
540 <DD><DL>\r
541
542 <DT><B>Returns:</B><DD>the position in the audio stream in milliseconds</DL>\r
543 </DD>\r
544 </DL>\r
545 <HR>\r
546 \r
547 <A NAME="resetTime()"><!-- --></A><H3>\r
548 resetTime</H3>\r
549 <PRE>\r
550 public void <B>resetTime</B>()</PRE>\r
551 <DL>\r
552 <DD>Resets the time for this audio stream to zero\r
553 <P>\r
554 <DD><DL>\r
555 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#resetTime()">resetTime</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
556 </DD>\r
557 <DD><DL>\r
558 </DL>\r
559 </DD>\r
560 </DL>\r
561 <HR>\r
562 \r
563 <A NAME="begin(int)"><!-- --></A><H3>\r
564 begin</H3>\r
565 <PRE>\r
566 public void <B>begin</B>(int&nbsp;size)</PRE>\r
567 <DL>\r
568 <DD>Starts the output of a set of data. Audio data for a single
569   utterance should be grouped between begin/end pairs.\r
570 <P>\r
571 <DD><DL>\r
572 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#begin(int)">begin</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
573 </DD>\r
574 <DD><DL>\r
575 <DT><B>Parameters:</B><DD><CODE>size</CODE> - the size of data between now and the end</DL>\r
576 </DD>\r
577 </DL>\r
578 <HR>\r
579 \r
580 <A NAME="end()"><!-- --></A><H3>\r
581 end</H3>\r
582 <PRE>\r
583 public boolean <B>end</B>()</PRE>\r
584 <DL>\r
585 <DD>Marks the end a set of data. Audio data for a single utterance should be
586  grouped between begin/end pairs.\r
587 <P>\r
588 <DD><DL>\r
589 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#end()">end</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
590 </DD>\r
591 <DD><DL>\r
592
593 <DT><B>Returns:</B><DD><code>true</code> if the audio was output properly,
594          <code>false </code> if the output was canceled or interrupted.</DL>\r
595 </DD>\r
596 </DL>\r
597 <HR>\r
598 \r
599 <A NAME="write(byte[])"><!-- --></A><H3>\r
600 write</H3>\r
601 <PRE>\r
602 public boolean <B>write</B>(byte[]&nbsp;audioData)</PRE>\r
603 <DL>\r
604 <DD>Writes the given bytes to the audio stream\r
605 <P>\r
606 <DD><DL>\r
607 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#write(byte[])">write</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
608 </DD>\r
609 <DD><DL>\r
610 <DT><B>Parameters:</B><DD><CODE>audioData</CODE> - audio data to write to the device
611 <DT><B>Returns:</B><DD><code>true</code> if the write completed successfully, 
612         <code> false </code>if the write was cancelled.</DL>\r
613 </DD>\r
614 </DL>\r
615 <HR>\r
616 \r
617 <A NAME="write(byte[], int, int)"><!-- --></A><H3>\r
618 write</H3>\r
619 <PRE>\r
620 public boolean <B>write</B>(byte[]&nbsp;bytes,
621                      int&nbsp;offset,
622                      int&nbsp;size)</PRE>\r
623 <DL>\r
624 <DD>Writes the given bytes to the audio stream\r
625 <P>\r
626 <DD><DL>\r
627 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#write(byte[], int, int)">write</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
628 </DD>\r
629 <DD><DL>\r
630 <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - audio data to write to the device<DD><CODE>offset</CODE> - the offset into the buffer<DD><CODE>size</CODE> - the size into the buffer
631 <DT><B>Returns:</B><DD><code>true</code> if the write completed successfully, 
632         <code> false </code>if the write was canceled.</DL>\r
633 </DD>\r
634 </DL>\r
635 <HR>\r
636 \r
637 <A NAME="toString()"><!-- --></A><H3>\r
638 toString</H3>\r
639 <PRE>\r
640 public java.lang.String <B>toString</B>()</PRE>\r
641 <DL>\r
642 <DD>Returns the name of this audio player\r
643 <P>\r
644 <DD><DL>\r
645 </DL>\r
646 </DD>\r
647 <DD><DL>\r
648
649 <DT><B>Returns:</B><DD>the name of the audio player</DL>\r
650 </DD>\r
651 </DL>\r
652 <HR>\r
653 \r
654 <A NAME="showMetrics()"><!-- --></A><H3>\r
655 showMetrics</H3>\r
656 <PRE>\r
657 public void <B>showMetrics</B>()</PRE>\r
658 <DL>\r
659 <DD>Shows metrics for this audio player\r
660 <P>\r
661 <DD><DL>\r
662 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#showMetrics()">showMetrics</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
663 </DD>\r
664 <DD><DL>\r
665 </DL>\r
666 </DD>\r
667 </DL>\r
668 <HR>\r
669 \r
670 <A NAME="startFirstSampleTimer()"><!-- --></A><H3>\r
671 startFirstSampleTimer</H3>\r
672 <PRE>\r
673 public void <B>startFirstSampleTimer</B>()</PRE>\r
674 <DL>\r
675 <DD>Starts the first sample timer\r
676 <P>\r
677 <DD><DL>\r
678 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html#startFirstSampleTimer()">startFirstSampleTimer</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/audio/AudioPlayer.html" title="interface in com.sun.speech.freetts.audio">AudioPlayer</A></CODE></DL>\r
679 </DD>\r
680 <DD><DL>\r
681 </DL>\r
682 </DD>\r
683 </DL>\r
684 <!-- ========= END OF CLASS DATA ========= -->\r
685 <HR>\r
686 \r
687
688 <!-- ======= START OF BOTTOM NAVBAR ====== -->\r
689 <A NAME="navbar_bottom"><!-- --></A>
690 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
691 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">\r
692 <TR>\r
693 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">\r
694 <A NAME="navbar_bottom_firstrow"><!-- --></A>
695 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">\r
696   <TR ALIGN="center" VALIGN="top">\r
697   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>\r
698   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>\r
699   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>\r
700   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>\r
701   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>\r
702   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>\r
703   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>\r
704   </TR>\r
705 </TABLE>\r
706 </TD>\r
707 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>\r
708 </EM>\r
709 </TD>\r
710 </TR>\r
711 \r
712 <TR>\r
713 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
714 &nbsp;PREV CLASS&nbsp;\r
715 &nbsp;<A HREF="../../../../../com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.html" title="class in com.sun.speech.freetts.audio"><B>NEXT CLASS</B></A></FONT></TD>\r
716 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">\r
717   <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;\r
718 &nbsp;<A HREF="JavaClipAudioPlayer.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;\r
719 &nbsp;<SCRIPT type="text/javascript">\r
720   <!--\r
721   if(window==top) {\r
722     document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');\r
723   }\r
724   //-->\r
725 </SCRIPT>\r
726 <NOSCRIPT>\r
727   <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>\r
728 </NOSCRIPT>
729 \r
730 </FONT></TD>\r
731 </TR>\r
732 <TR>\r
733 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
734   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>\r
735 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">\r
736 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>\r
737 </TR>\r
738 </TABLE>\r
739 <A NAME="skip-navbar_bottom"></A>
740 <!-- ======== END OF BOTTOM NAVBAR ======= -->\r
741 \r
742 <HR>\r
743 \r
744 </BODY>\r
745 </HTML>\r