类 DashScopeRealtimeTTSModel.Builder
java.lang.Object
io.agentscope.core.model.tts.DashScopeRealtimeTTSModel.Builder
Builder for constructing DashScopeRealtimeTTSModel instances.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Sets the API key for DashScope authentication.build()Builds the DashScopeRealtimeTTSModel instance.Sets the audio format.languageType(String languageType) Sets the language type for synthesis.Sets the session mode.Sets the TTS model name.sampleRate(int sampleRate) Sets the audio sample rate.Sets the voice for synthesis.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
apiKey
Sets the API key for DashScope authentication.- 参数:
apiKey- the API key- 返回:
- this builder
-
modelName
Sets the TTS model name.Supported models:
- qwen3-tts-flash-realtime - supports system voices
- qwen3-tts-vd-realtime - supports voice design via text description
- qwen3-tts-vc-realtime - supports voice cloning
- qwen-tts-realtime - legacy model
- 参数:
modelName- the model name- 返回:
- this builder
-
voice
Sets the voice for synthesis.Available voices include: Cherry, Serena, Ethan, Chelsie, etc.
- 参数:
voice- the voice name- 返回:
- this builder
-
sampleRate
Sets the audio sample rate.- 参数:
sampleRate- sample rate in Hz (default: 24000)- 返回:
- this builder
-
format
Sets the audio format.Supported formats: pcm, mp3, opus
- 参数:
format- audio format- 返回:
- this builder
-
mode
Sets the session mode.In
DashScopeRealtimeTTSModel.SessionMode.SERVER_COMMITmode, the server automatically commits text for synthesis. InDashScopeRealtimeTTSModel.SessionMode.COMMITmode, the client must manually callDashScopeRealtimeTTSModel.commitTextBuffer().- 参数:
mode- the session mode (default: SERVER_COMMIT)- 返回:
- this builder
-
languageType
Sets the language type for synthesis.Supported values: Chinese, English, German, Italian, Portuguese, Spanish, Japanese, Korean, French, Russian, Auto
- 参数:
languageType- the language type (default: Auto)- 返回:
- this builder
-
build
Builds the DashScopeRealtimeTTSModel instance.- 返回:
- a configured DashScopeRealtimeTTSModel
- 抛出:
IllegalArgumentException- if apiKey is not set
-