类 DashScopeTTSModel
java.lang.Object
io.agentscope.core.model.tts.DashScopeTTSModel
- 所有已实现的接口:
TTSModel
DashScope TTS Model implementation.
This implementation uses direct HTTP calls to DashScope's TTS API, supporting multiple TTS models including:
- qwen3-tts-flash - Qwen3 TTS fast model
- qwen-tts - Qwen TTS model
- sambert-* - Sambert series (e.g., sambert-zhimao-v1)
- cosyvoice-* - CosyVoice series
Example usage:
DashScopeTTSModel tts = DashScopeTTSModel.builder()
.apiKey(System.getenv("DASHSCOPE_API_KEY"))
.modelName("qwen3-tts-flash")
.voice("Cherry")
.build();
TTSResponse response = tts.synthesize("你好,世界!", null).block();
byte[] audioData = response.getAudioData();
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static classBuilder for constructing DashScopeTTSModel instances. -
字段概要
字段 -
方法概要
修饰符和类型方法说明static DashScopeTTSModel.Builderbuilder()Creates a new builder for DashScopeTTSModel.Returns the name of the TTS model being used.reactor.core.publisher.Mono<TTSResponse> synthesize(String text, TTSOptions options) Synthesizes speech from text using DashScope TTS API.
-
字段详细资料
-
DEFAULT_BASE_URL
Default base URL for DashScope API.- 另请参阅:
-
TTS_ENDPOINT
TTS API endpoint (uses multimodal-generation for qwen-tts models).- 另请参阅:
-
-
方法详细资料
-
synthesize
Synthesizes speech from text using DashScope TTS API.- 指定者:
synthesize在接口中TTSModel- 参数:
text- the text to convert to speechoptions- optional TTS configuration, uses defaults if null- 返回:
- a Mono containing the TTS response with audio data
-
getModelName
Returns the name of the TTS model being used.- 指定者:
getModelName在接口中TTSModel- 返回:
- the model name (e.g., "qwen3-tts-flash", "qwen-tts")
-
builder
Creates a new builder for DashScopeTTSModel.- 返回:
- a new Builder instance
-