public class RemoteMaryInterface extends Object implements MaryInterface
Constructor and Description |
---|
RemoteMaryInterface() |
RemoteMaryInterface(String serverHost,
int serverPort) |
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.
|
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.
|
void |
setStreamingAudio(boolean newIsStreaming)
Set whether to stream audio.
|
void |
setStyle(String newStyle)
Set the speaking style.
|
void |
setVoice(String newVoiceName)
Set the voice to be used for processing.
|
public RemoteMaryInterface() throws IOException
IOException
public RemoteMaryInterface(String serverHost, int serverPort) throws IOException
IOException
public void setInputType(String newInputType) throws IllegalArgumentException
MaryInterface
setInputType
in interface MaryInterface
newInputType
- a string representation of a MaryDataType.IllegalArgumentException
- if newInputType is not a valid and known input data type.public String getInputType()
MaryInterface
MaryInterface.setInputType(String)
.getInputType
in interface MaryInterface
public void setOutputType(String newOutputType) throws IllegalArgumentException
MaryInterface
setOutputType
in interface MaryInterface
newOutputType
- a string representation of a MaryDataType.IllegalArgumentException
- if newOutputType is not a valid and known output data type.public String getOutputType()
MaryInterface
MaryInterface.setInputType(String)
.getOutputType
in interface MaryInterface
public void setLocale(Locale newLocale) throws IllegalArgumentException
MaryInterface
setLocale
in interface MaryInterface
newLocale
- a supported locale.IllegalArgumentException
- if newLocale is not among the MaryInterface.getAvailableLocales()
.public Locale getLocale()
MaryInterface
MaryInterface.setLocale(Locale)
or indirectly through MaryInterface.setVoice(String)
.getLocale
in interface MaryInterface
public void setVoice(String newVoiceName) throws IllegalArgumentException
MaryInterface
setVoice
in interface MaryInterface
newVoiceName
- the name of a valid voice.IllegalArgumentException
- if voiceName is not among the MaryInterface.getAvailableVoices()
.public String getVoice()
MaryInterface
getVoice
in interface MaryInterface
public void setAudioEffects(String audioEffects)
MaryInterface
setAudioEffects
in interface MaryInterface
audioEffects
- audioEffectspublic String getAudioEffects()
MaryInterface
getAudioEffects
in interface MaryInterface
public void setStyle(String newStyle)
MaryInterface
setStyle
in interface MaryInterface
newStyle
- newStylepublic String getStyle()
MaryInterface
getStyle
in interface MaryInterface
public void setOutputTypeParams(String params)
MaryInterface
setOutputTypeParams
in interface MaryInterface
params
- paramspublic String getOutputTypeParams()
MaryInterface
getOutputTypeParams
in interface MaryInterface
public void setStreamingAudio(boolean newIsStreaming)
MaryInterface
setStreamingAudio
in interface MaryInterface
newIsStreaming
- newIsStreamingpublic boolean isStreamingAudio()
MaryInterface
isStreamingAudio
in interface MaryInterface
public String generateText(String text) throws SynthesisException
MaryInterface
generateText
in interface MaryInterface
text
- textSynthesisException
- SynthesisExceptionpublic String generateText(Document doc) throws SynthesisException
MaryInterface
generateText
in interface MaryInterface
doc
- docSynthesisException
- SynthesisExceptionpublic Document generateXML(String text) throws SynthesisException
MaryInterface
generateXML
in interface MaryInterface
text
- textSynthesisException
- SynthesisExceptionpublic Document generateXML(Document doc) throws SynthesisException
MaryInterface
generateXML
in interface MaryInterface
doc
- docSynthesisException
- SynthesisExceptionpublic AudioInputStream generateAudio(String text) throws SynthesisException
MaryInterface
generateAudio
in interface MaryInterface
text
- textSynthesisException
- SynthesisExceptionpublic AudioInputStream generateAudio(Document doc) throws SynthesisException
MaryInterface
generateAudio
in interface MaryInterface
doc
- docSynthesisException
- SynthesisExceptionpublic Set<String> getAvailableVoices()
MaryInterface
MaryInterface.setVoice(String)
.getAvailableVoices
in interface MaryInterface
public Set<String> getAvailableVoices(Locale aLocale)
MaryInterface
MaryInterface.setVoice(String)
.getAvailableVoices
in interface MaryInterface
aLocale
- localepublic Set<Locale> getAvailableLocales()
MaryInterface
MaryInterface.setLocale(Locale)
.getAvailableLocales
in interface MaryInterface
public Set<String> getAvailableInputTypes()
MaryInterface
MaryInterface.setInputType(String)
.getAvailableInputTypes
in interface MaryInterface
public Set<String> getAvailableOutputTypes()
MaryInterface
MaryInterface.setInputType(String)
.getAvailableOutputTypes
in interface MaryInterface
public boolean isTextType(String dataType)
MaryInterface
MaryInterface.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 MaryInterface
dataType
- an input or output data type.public boolean isXMLType(String dataType)
MaryInterface
MaryInterface.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 MaryInterface
dataType
- an input or output data type.public boolean isAudioType(String dataType)
MaryInterface
MaryInterface.generateAudio(String)
and MaryInterface.generateAudio(Document)
can be used.isAudioType
in interface MaryInterface
dataType
- an input or output data typeCopyright © 2000–2016 DFKI GmbH. All rights reserved.