2 * Portions Copyright 2001 Sun Microsystems, Inc.
3 * Portions Copyright 1999-2001 Language Technologies Institute,
4 * Carnegie Mellon University.
5 * All Rights Reserved. Use is subject to license terms.
7 * See the file "license.terms" for information on usage and
8 * redistribution of this file, and for a DISCLAIMER OF ALL
11 package com.sun.speech.freetts;
13 import org.w3c.dom.Document;
14 import java.io.InputStream;
17 * Represents something that should be spoken.
19 public interface FreeTTSSpeakable {
22 * Indicates that this speakable has been started.
24 public void started();
27 * Indicates that this speakable has been completed.
29 public void completed();
32 * Indicates that this speakable has been cancelled.
34 public void cancelled();
37 * Returns <code>true</code> if this queue item has been
40 * @return true if it has been processed
42 public boolean isCompleted();
45 * Waits for this speakable item to be completed.
47 * @return true if the item was completed successfully, false if
48 * the speakable was cancelled or an error occurred.
50 public boolean waitCompleted();
53 * Returns <code>true</code> if the item contains plain text
54 * (not Java Speech Markup Language text).
56 * @return true if the item contains plain text
58 public boolean isPlainText();
61 * Returns <code>true</code> if the item is an input stream.
63 * @return true if the item is an input stream
65 public boolean isStream();
68 * Returns <code>true</code> if the item is a JSML document
69 * (Java Speech Markup Language).
71 * @return true if the item is a document
73 public boolean isDocument();
76 * Returns the text corresponding to this Playable.
78 * @return the Playable text
80 public String getText();
83 * Gets the DOM document for this object.
85 * @return the DOM document for this object
87 public Document getDocument();
90 * Gets the input stream
92 * @return the input stream
94 public InputStream getInputStream();