public class Request extends Object
setInputData()
) or by reading it
from a Reader (readInputData()
). Third, the request is processed (process()
). Finally, the output
data is either accessed directly (getOutputData()
) or written to an output stream (writeOutputData
).Modifier and Type | Field and Description |
---|---|
protected boolean |
abortRequested |
protected AppendableSequenceAudioInputStream |
appendableAudioStream |
protected AudioFileFormat |
audioFileFormat |
protected String |
defaultEffects |
protected Locale |
defaultLocale |
protected String |
defaultStyle |
protected Voice |
defaultVoice |
protected int |
id |
protected MaryData |
inputData |
protected MaryDataType |
inputType |
protected org.apache.log4j.Logger |
logger |
protected MaryData |
outputData |
protected MaryDataType |
outputType |
protected String |
outputTypeParams |
protected boolean |
streamAudio |
protected Map<MaryModule,Long> |
timingInfo |
protected Set<MaryModule> |
usedModules |
Constructor and Description |
---|
Request(MaryDataType inputType,
MaryDataType outputType,
Locale defaultLocale,
Voice defaultVoice,
String defaultEffects,
String defaultStyle,
int id,
AudioFileFormat audioFileFormat) |
Request(MaryDataType inputType,
MaryDataType outputType,
Locale defaultLocale,
Voice defaultVoice,
String defaultEffects,
String defaultStyle,
int id,
AudioFileFormat audioFileFormat,
boolean streamAudio,
String outputTypeParams) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Inform this request that any further processing does not make sense.
|
AppendableSequenceAudioInputStream |
getAudio() |
AudioFileFormat |
getAudioFileFormat() |
String |
getDefaultEffects() |
Locale |
getDefaultLocale() |
String |
getDefaultStyle() |
Voice |
getDefaultVoice() |
int |
getId() |
MaryDataType |
getInputType() |
MaryData |
getOutputData()
Direct access to the output data.
|
MaryDataType |
getOutputType() |
boolean |
getStreamAudio() |
void |
process()
Process the input data to produce the output data.
|
void |
readInputData(Reader inputReader)
Read the input data from a Reader.
|
void |
setInputData(MaryData inputData)
Set the input data directly, in case it is already in the form of a MaryData object.
|
void |
setInputData(String inputText) |
void |
writeOutputData(OutputStream outputStream)
Write the output data to the specified OutputStream.
|
protected MaryDataType inputType
protected MaryDataType outputType
protected String outputTypeParams
protected AudioFileFormat audioFileFormat
protected AppendableSequenceAudioInputStream appendableAudioStream
protected Locale defaultLocale
protected Voice defaultVoice
protected String defaultStyle
protected String defaultEffects
protected int id
protected org.apache.log4j.Logger logger
protected MaryData inputData
protected MaryData outputData
protected boolean streamAudio
protected boolean abortRequested
protected Set<MaryModule> usedModules
protected Map<MaryModule,Long> timingInfo
public Request(MaryDataType inputType, MaryDataType outputType, Locale defaultLocale, Voice defaultVoice, String defaultEffects, String defaultStyle, int id, AudioFileFormat audioFileFormat)
public Request(MaryDataType inputType, MaryDataType outputType, Locale defaultLocale, Voice defaultVoice, String defaultEffects, String defaultStyle, int id, AudioFileFormat audioFileFormat, boolean streamAudio, String outputTypeParams)
public MaryDataType getInputType()
public MaryDataType getOutputType()
public Locale getDefaultLocale()
public Voice getDefaultVoice()
public String getDefaultStyle()
public String getDefaultEffects()
public int getId()
public AudioFileFormat getAudioFileFormat()
public AppendableSequenceAudioInputStream getAudio()
public boolean getStreamAudio()
public void abort()
public void setInputData(MaryData inputData)
inputData
- inputDatapublic void readInputData(Reader inputReader) throws Exception
inputReader
- inputReaderException
- Exceptionpublic void process() throws Exception
Exception
- Exceptionfor direct access to the resulting output data
,
for writing the output data to a stream
public MaryData getOutputData()
public void writeOutputData(OutputStream outputStream) throws Exception
outputStream
- outputStreamException
- ExceptionCopyright © 2000–2016 DFKI GmbH. All rights reserved.