public static class SynthesisRequest.Builder extends Object
TTSInput
object piecemeal.Constructor and Description |
---|
Builder(CharSequence text)
Create a new
TTSInput builder with the only required data,
the text to be synthesized. |
Modifier and Type | Method and Description |
---|---|
SynthesisRequest |
build()
Use the state of the builder to construct a fully specified synthesis
request.
|
SynthesisRequest.Builder |
withData(Map<String,String> requestData)
Specify additional data to be used for the synthesis request.
|
SynthesisRequest.Builder |
withMode(SynthesisRequest.Mode mode)
Specify the synthesis mode.
|
SynthesisRequest.Builder |
withVoice(String voice)
Specify the voice to be used for synthesis.
|
public Builder(CharSequence text)
TTSInput
builder with the only required data,
the text to be synthesized. The default synthesis mode (text) and
voice will be used.text
- The text to be synthesized.public SynthesisRequest.Builder withMode(SynthesisRequest.Mode mode)
mode
- The synthesis mode, TEXT
(default) or SSML
.public SynthesisRequest.Builder withVoice(String voice)
voice
- The voice to be used for synthesized audio.public SynthesisRequest.Builder withData(Map<String,String> requestData)
requestData
- Additional data to be sent as part of the TTS
request.public SynthesisRequest build()
Copyright © 2020. All rights reserved.