Class TtsService
java.lang.Object
com.alibaba.dashscope.resources.audio.TtsService
audio.tts resource: HTTP one-shot/streaming synthesis plus ws duplex sessions. The sugar
entries are HTTP forms; duplex-capable models (cosyvoice family) should use connect(com.alibaba.dashscope.types.audio.TtsConnectParams)
(routing table: AudioModelRouter).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect(TtsConnectParams params) ws duplex session; lazy — nothing connects untilstart().connect(TtsConnectParams params, RequestOptions options) connect(TtsConnectParams params, WsConnection connection) ws duplex multiplexed on a shared connection (audio design §7).connect(TtsConnectParams params, WsConnection connection, RequestOptions options) http()Explicit HTTP form (model-name routed); identical to the sugar entries.ResponseStream<byte[]>stream(TtsSynthesizeParams params) Streaming synthesis over HTTP SSE.ResponseStream<byte[]>stream(TtsSynthesizeParams params, RequestOptions options) byte[]synthesize(TtsSynthesizeParams params) One-shot synthesis over HTTP SSE (aggregated in memory; prefer stream for long text).byte[]synthesize(TtsSynthesizeParams params, RequestOptions options)
-
Constructor Details
-
TtsService
-
-
Method Details
-
synthesize
One-shot synthesis over HTTP SSE (aggregated in memory; prefer stream for long text). -
synthesize
-
stream
Streaming synthesis over HTTP SSE. -
stream
-
http
Explicit HTTP form (model-name routed); identical to the sugar entries. -
connect
ws duplex session; lazy — nothing connects untilstart(). -
connect
-
connect
ws duplex multiplexed on a shared connection (audio design §7). -
connect
public SynthesisSession connect(TtsConnectParams params, WsConnection connection, RequestOptions options)
-