|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.xml.AbstractXmlNode
org.jvoicexml.xml.ssml.Audio
public final class Audio
Audio can be played in any prompt. The audio content can be specified via a URI, and in VoiceXML it can also be in an audio variable previously recorded.
<prompt>
Your recorded greeting is
<audio expr="greeting"/>
To rerecord, press 1.
To keep it, press pound.
To return to the main menu press star M.
To exit press star, star X.
</prompt>
The <audio> element can have alternate content in case
the audio sample is not available:
<prompt>
<audio src="welcome.wav">
<emphasis>Welcome </emphasis> to the Voice Portal.
</audio>
</prompt>
If the audio file cannot be played (e.g. 'src' referencing or 'expr' evaluating to an invalid URI, a file with an unsupported format, etc), the content of the audio element is played instead. The content may include text, speech markup, or another audio element. If the audio file cannot be played and the content of the audio element is empty, no audio is played and no error event is thrown.
If <audio> contains an 'expr' attribute evaluating to
ECMAScript undefined, then the element, including its alternate content, is
ignored. This allows a developer to specify <audio>
elements with dynamically assigned content which, if the element is not
required, can be ignored by assigning its 'expr' a null value.
Copyright © 2005-2006 JVoiceXML group - http://jvoicexml.sourceforge.net/
Form,
Prompt| Field Summary | |
|---|---|
static String |
ATTRIBUTE_EXPR
An ECMAScript expression which determines the source of the audio to be played. |
static String |
ATTRIBUTE_FETCHHINT
Defines when the interpreter context should retrieve content from the server. prefetch indicates a file may be downloaded when the page is loaded, whereas safe indicates a file that should only be downloaded when actually needed. |
static String |
ATTRIBUTE_FETCHTIMEOUT
The interval to wait for the content to be returned before throwing an error.badfetch event. |
static String |
ATTRIBUTE_MAXAGE
Indicates that the document is willing to use content whose age is no greater than the specified time in seconds. |
static String |
ATTRIBUTE_MAXSTALE
Indicates that the document is willing to use content that has exceeded its expiration time. |
protected static ArrayList<String> |
ATTRIBUTE_NAMES
Supported attribute names for this node. |
static String |
ATTRIBUTE_SRC
The URI of the audio prompt. |
static String |
TAG_NAME
Name of the tag. |
| Constructor Summary | |
|---|---|
Audio()
Construct a new audio object without a node. |
|
| Method Summary | |
|---|---|
protected boolean |
canContainChild(String tagName)
Can the specified sub-tag be contained within this node? |
Collection<String> |
getAttributeNames()
Returns a collection of permitted attribute names for the node. |
NodeList |
getChildNodes()
A NodeList that contains all children of this node. |
String |
getExpr()
Retrieve the expr attribute. |
String |
getFetchhint()
Retrieve the fetchhint attribute. |
String |
getFetchtimeout()
Retrieve the fetchtimeout attribute. |
String |
getMaxage()
Retrieve the maxage attribute. |
String |
getMaxstale()
Retrieve the maxstale attribute. |
String |
getSrc()
Retrieve the src attribute. |
String |
getTagName()
Get the name of the tag for the derived node. |
XmlNode |
newInstance(Node n)
Create a new instance for the given node. |
void |
setExpr(String expr)
Set the expr attribute. |
void |
setFetchhint(String fetchhint)
Set the fetchhint attribute. |
void |
setFetchtimeout(String fetchtimeout)
Set the fetchtimeout attribute. |
void |
setMaxage(String maxage)
Set the maxage attribute. |
void |
setMaxstale(String maxstale)
Set the maxstale attribute. |
void |
setSrc(String src)
Set the src attribute. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jvoicexml.xml.XmlNode |
|---|
addChild, getAttribute, getChildNodes, getNode, setAttribute |
| Methods inherited from interface org.jvoicexml.xml.XmlWritable |
|---|
writeChildrenXml, writeXml |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| Field Detail |
|---|
public static final String TAG_NAME
public static final String ATTRIBUTE_SRC
public static final String ATTRIBUTE_FETCHTIMEOUT
public static final String ATTRIBUTE_FETCHHINT
public static final String ATTRIBUTE_MAXAGE
public static final String ATTRIBUTE_MAXSTALE
public static final String ATTRIBUTE_EXPR
<record/> item or evaluate to the
URI of an audio resource to fetch.
protected static final ArrayList<String> ATTRIBUTE_NAMES
| Constructor Detail |
|---|
public Audio()
This is necessary for the node factory.
VoiceXmlNodeFactory| Method Detail |
|---|
public String getTagName()
getTagName in interface XmlNodepublic XmlNode newInstance(Node n)
Each XmlNode can serve as a prototype in a
XmlNodeFactory to produce a collection of
child nodes. Factories can then use the prototype pattern to
produce new nodes.
newInstance in interface XmlNoden - The node to encapsulate.
XmlNodeFactorypublic String getSrc()
ATTRIBUTE_SRCpublic void setSrc(String src)
src - Value of the src attribute.ATTRIBUTE_SRCpublic String getFetchtimeout()
ATTRIBUTE_FETCHTIMEOUTpublic void setFetchtimeout(String fetchtimeout)
fetchtimeout - Value of the fetchtimeout attribute.ATTRIBUTE_FETCHTIMEOUTpublic String getFetchhint()
ATTRIBUTE_FETCHHINTpublic void setFetchhint(String fetchhint)
fetchhint - Value of the fetchhint attribute.ATTRIBUTE_FETCHHINTpublic String getMaxage()
ATTRIBUTE_MAXAGEpublic void setMaxage(String maxage)
maxage - Value of the maxage attribute.ATTRIBUTE_MAXAGEpublic String getMaxstale()
ATTRIBUTE_MAXSTALEpublic void setMaxstale(String maxstale)
maxstale - Value of the maxstale attribute.ATTRIBUTE_MAXSTALEpublic String getExpr()
ATTRIBUTE_EXPRpublic void setExpr(String expr)
expr - Value of the expr attribute.ATTRIBUTE_EXPRprotected boolean canContainChild(String tagName)
canContainChild in class AbstractXmlNodetagName - Name of child.
public Collection<String> getAttributeNames()
getAttributeNames in interface XmlNodegetAttributeNames in class AbstractXmlNodepublic final NodeList getChildNodes()
NodeList that contains all children of this node.
getChildNodes in interface Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||