Class SpeechSynthesisRequest
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.SpeechSynthesisRequest
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
PersonalVoiceSynthesisRequest
public class SpeechSynthesisRequest extends Object implements AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSpeechSynthesisRequest.SpeechSynthesisInputStreamstatic classSpeechSynthesisRequest.SpeechSynthesisRequestInputType
-
Constructor Summary
Constructors Constructor Description SpeechSynthesisRequest(SpeechSynthesisRequest.SpeechSynthesisRequestInputType inputType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidfinishInput()SpeechSynthesisRequest.SpeechSynthesisInputStreamgetInputStream()Gets the input stream for the speech synthesis request.SafeHandlegetRequestHandle()voidsendTextPiece(String text)voidsetPitch(String pitch)Sets the pitch of the voice.voidsetRate(String rate)Sets the speaking rate of the voice.voidsetStyle(String style)Sets the style of the voice.voidsetTemperature(double temperature)Sets the temperature for voice synthesis.voidsetVolume(String volume)Sets the volume of the voice.
-
-
-
Constructor Detail
-
SpeechSynthesisRequest
public SpeechSynthesisRequest(SpeechSynthesisRequest.SpeechSynthesisRequestInputType inputType)
-
-
Method Detail
-
getRequestHandle
public SafeHandle getRequestHandle()
-
getInputStream
public SpeechSynthesisRequest.SpeechSynthesisInputStream getInputStream()
Gets the input stream for the speech synthesis request.- Returns:
- The input stream.
-
setPitch
public void setPitch(String pitch)
Sets the pitch of the voice.- Parameters:
pitch- The pitch value (e.g., "high", "low", "+10%", "-10Hz").
-
setRate
public void setRate(String rate)
Sets the speaking rate of the voice.- Parameters:
rate- The rate value (e.g., "fast", "slow", "50%", "1.5").
-
setVolume
public void setVolume(String volume)
Sets the volume of the voice.- Parameters:
volume- The volume value (e.g., "loud", "soft", "0.8", "80%").
-
setStyle
public void setStyle(String style)
Sets the style of the voice.- Parameters:
style- The style value.
-
setTemperature
public void setTemperature(double temperature)
Sets the temperature for voice synthesis.- Parameters:
temperature- The temperature value (0.0 to 2.0).
-
sendTextPiece
public void sendTextPiece(String text)
-
finishInput
public void finishInput()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-