| model(String) | String | 是 | 语音合成模型。 |
| text(String) | String | 是 | 待合成文本。支持 SSML 和 LaTeX 格式输入。将待合成文本替换为对应格式即可。
- 使用 SSML 时,需同时将
enable_ssml 设置为 true。支持的 SSML 标签及用法,请参见SSML 与 LaTeX。
- 使用 LaTeX 时,将待合成文本替换为 LaTeX 格式即可,无需额外配置。支持的 LaTeX 语法及用法,请参见LaTeX 公式转语音。
|
| voice(String) | String | 是 | 音色。取值范围: |
| format(String) | String | 否 | 音频编码格式。默认值:mp3。取值范围: |
| sampleRate(int) | int | 否 | 音频采样率(Hz)。取值范围:8000, 16000, 22050(默认), 24000, 44100, 48000。 |
| volume(int) | int | 否 | 音量。默认值:50。取值范围:[0, 100]。 |
| rate(float) | float | 否 | 语速。默认值:1.0。取值范围:[0.5, 2.0]。 |
| pitch(float) | float | 否 | 音调。默认值:1.0。取值范围:[0.5, 2.0]。 |
enable_ssml | boolean | 否 | 是否开启SSML功能。设置为true时,text参数需传入SSML格式文本。支持的SSML标签及用法,请参见SSML 与 LaTeX。SSML 的使用限制(支持的模型、音色和接口),请参见使用限制。默认值:false。enable_ssml需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("<speak>你好</speak>")
.voice("longanhuan_v3.6")
.parameter("enable_ssml", true)
.build();
|
word_timestamp_enabled | boolean | 否 | 是否开启字级别时间戳。默认值:false。仅在流式输出模式下可用。支持复刻音色;支持的系统音色请参见Qwen-Audio-TTS音色列表。word_timestamp_enabled需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("word_timestamp_enabled", true)
.build();
|
seed | int | 否 | 生成时使用的随机数种子,使合成的效果产生变化。在模型版本、文本、音色及其他参数均相同的前提下,使用相同的seed可复现相同的合成结果。默认值0。取值范围:[0, 65535]。seed需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("seed", 1234)
.build();
|
language_hints | List | 否 |
- 此参数为数组,但当前版本仅处理第一个元素,因此建议只传入一个值。
- 此参数用于指定语音合成的目标语言,该设置与声音复刻时的样本音频的语种无关。如需设置复刻任务的源语言,请参见声音复刻API参考。
指定语音合成的目标语言,提升合成效果。当数字、缩写、符号等朗读方式或者小语种合成效果不符合预期时使用,例如:
- 数字朗读方式不符合预期,“hello, this is 110”读成“hello, this is one one zero”而非“hello, this is 幺幺零”
- 符号朗读不准确,“@”读成“艾特”而非“at”
- 小语种合成效果差,合成不自然
- zh:中文
- en:英语
- fr:法语
- de:德语
- ja:日语
- ko:韩语
- ru:俄语
- pt:葡萄牙语
- th:泰语
- id:印尼语
- vi:越南语
- es:西班牙语
- it:意大利语
- ms:马来西亚语
- fil:菲律宾语
- ar:阿拉伯语
language_hints需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("language_hints", Arrays.asList("zh"))
.build();
|
instruction | String | 否 | 设置指令,用于控制方言、情感或角色等合成效果。具体用法请参见非实时语音合成。instruction需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("instruction", "请用非常开心的语气说话。")
.build();
|
bit_rate | int | 否 | 音频码率(单位:kbps)。默认值:32。取值范围:[6, 510]。bit_rate需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.format("opus")
.parameter("bit_rate", 32)
.build();
|
enable_aigc_tag | boolean | 否 | 是否在生成的音频中添加AIGC隐性标识。设置为true时,会将隐性标识嵌入到支持格式(wav/mp3/opus)的音频中。默认值:false。enable_aigc_tag需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("enable_aigc_tag", true)
.build();
|
aigc_propagator | String | 否 | 设置AIGC隐性标识中的 ContentPropagator 字段,用于标识内容的传播者。仅在 enable_aigc_tag 为 true 时生效。默认值:阿里云UID。aigc_propagator需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("enable_aigc_tag", true)
.parameter("aigc_propagator", "xxxx")
.build();
|
aigc_propagate_id | String | 否 | 设置AIGC隐性标识中的 PropagateID 字段,用于唯一标识一次具体的传播行为。仅在 enable_aigc_tag 为 true 时生效。默认值:本次语音合成请求Request ID。aigc_propagate_id需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("我家的后面有一个很大的花园。")
.voice("longanhuan_v3.6")
.parameter("enable_aigc_tag", true)
.parameter("aigc_propagate_id", "xxxx")
.build();
|
hot_fix | Map | 否 | 文本热修复配置,用于自定义指定词语的发音或对待合成文本进行替换。参数介绍:
- pronunciation:自定义发音。指定词语的拼音标注,用于纠正默认发音不准确的情况。
- replace:文本替换。在语音合成前将指定词语替换为目标文本,替换后的文本将作为实际合成内容。
示例:"hot_fix": {
"pronunciation": [
{"天气": "tian1 qi4"}
],
"replace": [
{"今天": "金天"}
]
}
hot_fix需要通过HttpSpeechSynthesisParam实例的parameter方法或者parameters方法进行设置:Map<String, Object> hotFix = new HashMap<>();
List<Map<String, String>> pronunciation = new ArrayList<>();
Map<String, String> pronItem = new HashMap<>();
pronItem.put("天气", "tian1 qi4");
pronunciation.add(pronItem);
hotFix.put("pronunciation", pronunciation);
List<Map<String, String>> replace = new ArrayList<>();
Map<String, String> replaceItem = new HashMap<>();
replaceItem.put("今天", "金天");
replace.add(replaceItem);
hotFix.put("replace", replace);
HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
.model("qwen-audio-3.0-tts-flash")
.text("今天天气真好。")
.voice("longanhuan_v3.6")
.parameter("hot_fix", hotFix)
.build();
|