public class LocalMaryInterface extends Object implements MaryInterface
| Constructor and Description |
|---|
LocalMaryInterface() |
| Modifier and Type | Method and Description |
|---|---|
AudioInputStream |
generateAudio(Document doc)
Synthesis from an XML format, such as SSML, to audio.
|
AudioInputStream |
generateAudio(String text)
Synthesis from a text format to audio.
|
String |
generateText(Document doc)
Partial processing command, converting an input XML format such as SSML into an output text format such as TARGETFEATURES.
|
String |
generateText(String text)
Partial processing command, converting an input text format such as TEXT into an output text format such as TARGETFEATURES.
|
Document |
generateXML(Document doc)
Partial processing command, converting one XML format such as RAWMARYXML into another XML format such as TOKENS.
|
Document |
generateXML(String text)
Partial processing command, converting an input text format such as TEXT into an XML format such as ALLOPHONES.
|
String |
getAudioEffects()
Get the currently set audio effects.
|
Set<String> |
getAvailableInputTypes()
List the names of the input types that can be used in
MaryInterface.setInputType(String). |
Set<Locale> |
getAvailableLocales()
List the locales that can be used in
MaryInterface.setLocale(Locale). |
Set<String> |
getAvailableOutputTypes()
List the names of the input types that can be used in
MaryInterface.setInputType(String). |
Set<String> |
getAvailableVoices()
List the names of all the voices that can be used in
MaryInterface.setVoice(String). |
Set<String> |
getAvailableVoices(Locale aLocale)
List the names of all the voices for the given locale that can be used in
MaryInterface.setVoice(String). |
String |
getInputType()
Get the current input type, either the default ("TEXT") or the value most recently set through
MaryInterface.setInputType(String). |
Locale |
getLocale()
Get the current locale used for processing.
|
String |
getOutputType()
Get the current output type, either the default ("AUDIO") or the value most recently set through
MaryInterface.setInputType(String). |
String |
getOutputTypeParams()
Get the currently set output type parameters.
|
String |
getStyle()
Get the currently speaking style.
|
String |
getVoice()
The name of the current voice, if any.
|
protected void |
init() |
boolean |
isAudioType(String dataType)
Check whether the given data type is an audio type.
|
boolean |
isStreamingAudio()
Whether to stream audio.
|
boolean |
isTextType(String dataType)
Check whether the given data type is a text type.
|
boolean |
isXMLType(String dataType)
Check whether the given data type is an XML type.
|
void |
setAudioEffects(String audioEffects)
Set the audio effects.
|
void |
setInputType(String newInputType)
Set the input type for processing to the new input type.
|
void |
setLocale(Locale newLocale)
Set the locale for processing.
|
void |
setOutputType(String newOutputType)
Set the output type for processing to the new output type.
|
void |
setOutputTypeParams(String params)
Set the output type parameters.
|
protected void |
setReasonableDefaults() |
void |
setStreamingAudio(boolean newIsStreaming)
Set whether to stream audio.
|
void |
setStyle(String newStyle)
Set the speaking style.
|
void |
setVoice(String voiceName)
Set the voice to be used for processing.
|
public LocalMaryInterface()
throws MaryConfigurationException
MaryConfigurationExceptionprotected void init()
protected void setReasonableDefaults()
public void setInputType(String newInputType) throws IllegalArgumentException
MaryInterfacesetInputType in interface MaryInterfacenewInputType - a string representation of a MaryDataType.IllegalArgumentException - if newInputType is not a valid and known input data type.public String getInputType()
MaryInterfaceMaryInterface.setInputType(String).getInputType in interface MaryInterfacepublic void setOutputType(String newOutputType) throws IllegalArgumentException
MaryInterfacesetOutputType in interface MaryInterfacenewOutputType - a string representation of a MaryDataType.IllegalArgumentException - if newOutputType is not a valid and known output data type.public String getOutputType()
MaryInterfaceMaryInterface.setInputType(String).getOutputType in interface MaryInterfacepublic void setLocale(Locale newLocale) throws IllegalArgumentException
MaryInterfacesetLocale in interface MaryInterfacenewLocale - a supported locale.IllegalArgumentException - if newLocale is not among the MaryInterface.getAvailableLocales().public Locale getLocale()
MaryInterfaceMaryInterface.setLocale(Locale) or indirectly through MaryInterface.setVoice(String).getLocale in interface MaryInterfacepublic void setVoice(String voiceName) throws IllegalArgumentException
MaryInterfacesetVoice in interface MaryInterfacevoiceName - the name of a valid voice.IllegalArgumentException - if voiceName is not among the MaryInterface.getAvailableVoices().public String getVoice()
MaryInterfacegetVoice in interface MaryInterfacepublic void setAudioEffects(String audioEffects)
MaryInterfacesetAudioEffects in interface MaryInterfaceaudioEffects - audioEffectspublic String getAudioEffects()
MaryInterfacegetAudioEffects in interface MaryInterfacepublic void setStyle(String newStyle)
MaryInterfacesetStyle in interface MaryInterfacenewStyle - newStylepublic String getStyle()
MaryInterfacegetStyle in interface MaryInterfacepublic void setOutputTypeParams(String params)
MaryInterfacesetOutputTypeParams in interface MaryInterfaceparams - paramspublic String getOutputTypeParams()
MaryInterfacegetOutputTypeParams in interface MaryInterfacepublic void setStreamingAudio(boolean newIsStreaming)
MaryInterfacesetStreamingAudio in interface MaryInterfacenewIsStreaming - newIsStreamingpublic boolean isStreamingAudio()
MaryInterfaceisStreamingAudio in interface MaryInterfacepublic String generateText(String text) throws SynthesisException
MaryInterfacegenerateText in interface MaryInterfacetext - textSynthesisException - SynthesisExceptionpublic String generateText(Document doc) throws SynthesisException
MaryInterfacegenerateText in interface MaryInterfacedoc - docSynthesisException - SynthesisExceptionpublic Document generateXML(String text) throws SynthesisException
MaryInterfacegenerateXML in interface MaryInterfacetext - textSynthesisException - SynthesisExceptionpublic Document generateXML(Document doc) throws SynthesisException
MaryInterfacegenerateXML in interface MaryInterfacedoc - docSynthesisException - SynthesisExceptionpublic AudioInputStream generateAudio(String text) throws SynthesisException
MaryInterfacegenerateAudio in interface MaryInterfacetext - textSynthesisException - SynthesisExceptionpublic AudioInputStream generateAudio(Document doc) throws SynthesisException
MaryInterfacegenerateAudio in interface MaryInterfacedoc - docSynthesisException - SynthesisExceptionpublic Set<String> getAvailableVoices()
MaryInterfaceMaryInterface.setVoice(String).getAvailableVoices in interface MaryInterfacepublic Set<String> getAvailableVoices(Locale aLocale)
MaryInterfaceMaryInterface.setVoice(String).getAvailableVoices in interface MaryInterfaceaLocale - localepublic Set<Locale> getAvailableLocales()
MaryInterfaceMaryInterface.setLocale(Locale).getAvailableLocales in interface MaryInterfacepublic Set<String> getAvailableInputTypes()
MaryInterfaceMaryInterface.setInputType(String).getAvailableInputTypes in interface MaryInterfacepublic Set<String> getAvailableOutputTypes()
MaryInterfaceMaryInterface.setInputType(String).getAvailableOutputTypes in interface MaryInterfacepublic boolean isTextType(String dataType)
MaryInterfaceMaryInterface.getAvailableInputTypes()) that are text types, the synthesis methods MaryInterface.generateText(String),
MaryInterface.generateXML(String) and MaryInterface.generateAudio(String) can be used; for output types that are text types, the
synthesis methods MaryInterface.generateText(String) and MaryInterface.generateText(Document) can be used.isTextType in interface MaryInterfacedataType - an input or output data type.public boolean isXMLType(String dataType)
MaryInterfaceMaryInterface.getAvailableInputTypes()) that are XML types, the synthesis methods MaryInterface.generateText(Document),
MaryInterface.generateXML(Document) and MaryInterface.generateAudio(Document) can be used; for output types that are XML types, the
synthesis methods MaryInterface.generateXML(String) and MaryInterface.generateXML(Document) can be used.isXMLType in interface MaryInterfacedataType - an input or output data type.public boolean isAudioType(String dataType)
MaryInterfaceMaryInterface.generateAudio(String) and MaryInterface.generateAudio(Document) can be used.isAudioType in interface MaryInterfacedataType - an input or output data typeCopyright © 2000–2016 DFKI GmbH. All rights reserved.