public class TextToVoiceRequest extends AbstractModel
header, skipSign| Constructor and Description | 
|---|
| TextToVoiceRequest() | 
| TextToVoiceRequest(TextToVoiceRequest source)NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getCodec()Get 返回音频格式,可取值:wav(默认),mp3,pcm | 
| String | getEmotionCategory()Get 控制合成音频的情感,仅支持多情感音色使用。取值: neutral(中性)、sad(悲伤)、happy(高兴)、angry(生气)、fear(恐惧)、news(新闻)、story(故事)、radio(广播)、poetry(诗歌)、call(客服)、sajiao(撒娇)、disgusted(厌恶)、amaze(震惊)、peaceful(平静)、exciting(兴奋)、aojiao(傲娇)、jieshuo(解说)
示例值:neutral | 
| Long | getEmotionIntensity()Get 控制合成音频情感程度,取值范围为[50,200],默认为100;只有EmotionCategory不为空时生效; | 
| Boolean | getEnableSubtitle()Get 是否开启时间戳功能,默认为false。 | 
| String | getFastVoiceType()Get 一句话版声音复刻音色ID,使用一句话版声音复刻音色时需填写。 | 
| Long | getModelType()Get 模型类型,1-默认模型。 | 
| Long | getPrimaryLanguage()Get 主语言类型:1-中文(默认)2-英文3-日文 | 
| Long | getProjectId()Get 项目id,用户自定义,默认为0。 | 
| Long | getSampleRate()Get 音频采样率:
24000:24k(部分音色支持,请参见[音色列表](https://cloud.tencent.com/document/product/1073/92668))
16000:16k(默认)
8000:8k | 
| Long | getSegmentRate()Get 断句敏感阈值,默认值为:0,取值范围:[0,1,2]。该值越大越不容易断句,模型会更倾向于仅按照标点符号断句。此参数建议不要随意调整,可能会影响合成效果。 | 
| String | getSessionId()Get 一次请求对应一个SessionId,会原样返回,建议传入类似于uuid的字符串防止重复。 | 
| Float | getSpeed()Get 语速,范围:[-2,6],分别对应不同语速:-2代表0.6倍-1代表0.8倍0代表1.0倍(默认)1代表1.2倍2代表1.5倍6代表2.5倍如果需要更细化的语速,可以保留小数点后 2 位,例如0.5/1.25/2.81等。 参数值与实际语速转换,可参考[代码示例](https://sdk-1300466766.cos.ap-shanghai.myqcloud.com/sample/speed_sample.tar.gz) | 
| String | getText()Get 合成语音的源文本,按UTF-8编码统一计算。
中文最大支持150个汉字(全角标点符号算一个汉字);英文最大支持500个字母(半角标点符号算一个字母)。 | 
| Long | getVoiceType()Get 音色 ID,包括精品音色、大模型音色与基础版复刻音色。不同音色价格有差异,详情请参见[购买指南](https://cloud.tencent.com/document/product/1073/34112)。完整的音色 ID 列表请参见[音色列表](https://cloud.tencent.com/document/product/1073/92668)。 若使用一句话版声音复刻,请填入固定值“200000000”。 | 
| Float | getVolume()Get 音量大小,范围[-10,10],对应音量大小。默认为0,代表正常音量,值越大音量越高。 | 
| void | setCodec(String Codec)Set 返回音频格式,可取值:wav(默认),mp3,pcm | 
| void | setEmotionCategory(String EmotionCategory)Set 控制合成音频的情感,仅支持多情感音色使用。取值: neutral(中性)、sad(悲伤)、happy(高兴)、angry(生气)、fear(恐惧)、news(新闻)、story(故事)、radio(广播)、poetry(诗歌)、call(客服)、sajiao(撒娇)、disgusted(厌恶)、amaze(震惊)、peaceful(平静)、exciting(兴奋)、aojiao(傲娇)、jieshuo(解说)
示例值:neutral | 
| void | setEmotionIntensity(Long EmotionIntensity)Set 控制合成音频情感程度,取值范围为[50,200],默认为100;只有EmotionCategory不为空时生效; | 
| void | setEnableSubtitle(Boolean EnableSubtitle)Set 是否开启时间戳功能,默认为false。 | 
| void | setFastVoiceType(String FastVoiceType)Set 一句话版声音复刻音色ID,使用一句话版声音复刻音色时需填写。 | 
| void | setModelType(Long ModelType)Set 模型类型,1-默认模型。 | 
| void | setPrimaryLanguage(Long PrimaryLanguage)Set 主语言类型:1-中文(默认)2-英文3-日文 | 
| void | setProjectId(Long ProjectId)Set 项目id,用户自定义,默认为0。 | 
| void | setSampleRate(Long SampleRate)Set 音频采样率:
24000:24k(部分音色支持,请参见[音色列表](https://cloud.tencent.com/document/product/1073/92668))
16000:16k(默认)
8000:8k | 
| void | setSegmentRate(Long SegmentRate)Set 断句敏感阈值,默认值为:0,取值范围:[0,1,2]。该值越大越不容易断句,模型会更倾向于仅按照标点符号断句。此参数建议不要随意调整,可能会影响合成效果。 | 
| void | setSessionId(String SessionId)Set 一次请求对应一个SessionId,会原样返回,建议传入类似于uuid的字符串防止重复。 | 
| void | setSpeed(Float Speed)Set 语速,范围:[-2,6],分别对应不同语速:-2代表0.6倍-1代表0.8倍0代表1.0倍(默认)1代表1.2倍2代表1.5倍6代表2.5倍如果需要更细化的语速,可以保留小数点后 2 位,例如0.5/1.25/2.81等。 参数值与实际语速转换,可参考[代码示例](https://sdk-1300466766.cos.ap-shanghai.myqcloud.com/sample/speed_sample.tar.gz) | 
| void | setText(String Text)Set 合成语音的源文本,按UTF-8编码统一计算。
中文最大支持150个汉字(全角标点符号算一个汉字);英文最大支持500个字母(半角标点符号算一个字母)。 | 
| void | setVoiceType(Long VoiceType)Set 音色 ID,包括精品音色、大模型音色与基础版复刻音色。不同音色价格有差异,详情请参见[购买指南](https://cloud.tencent.com/document/product/1073/34112)。完整的音色 ID 列表请参见[音色列表](https://cloud.tencent.com/document/product/1073/92668)。 若使用一句话版声音复刻,请填入固定值“200000000”。 | 
| void | setVolume(Float Volume)Set 音量大小,范围[-10,10],对应音量大小。默认为0,代表正常音量,值越大音量越高。 | 
| void | toMap(HashMap<String,String> map,
     String prefix)Internal implementation, normal users should not use it. | 
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, isStream, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonStringpublic TextToVoiceRequest()
public TextToVoiceRequest(TextToVoiceRequest source)
public String getText()
public void setText(String Text)
Text - 合成语音的源文本,按UTF-8编码统一计算。
中文最大支持150个汉字(全角标点符号算一个汉字);英文最大支持500个字母(半角标点符号算一个字母)。public String getSessionId()
public void setSessionId(String SessionId)
SessionId - 一次请求对应一个SessionId,会原样返回,建议传入类似于uuid的字符串防止重复。public Float getVolume()
public void setVolume(Float Volume)
Volume - 音量大小,范围[-10,10],对应音量大小。默认为0,代表正常音量,值越大音量越高。public Float getSpeed()
public void setSpeed(Float Speed)
Speed - 语速,范围:[-2,6],分别对应不同语速:public Long getProjectId()
public void setProjectId(Long ProjectId)
ProjectId - 项目id,用户自定义,默认为0。public Long getModelType()
public void setModelType(Long ModelType)
ModelType - 模型类型,1-默认模型。public Long getVoiceType()
public void setVoiceType(Long VoiceType)
VoiceType - 音色 ID,包括精品音色、大模型音色与基础版复刻音色。不同音色价格有差异,详情请参见[购买指南](https://cloud.tencent.com/document/product/1073/34112)。完整的音色 ID 列表请参见[音色列表](https://cloud.tencent.com/document/product/1073/92668)。public String getFastVoiceType()
public void setFastVoiceType(String FastVoiceType)
FastVoiceType - 一句话版声音复刻音色ID,使用一句话版声音复刻音色时需填写。public Long getPrimaryLanguage()
public void setPrimaryLanguage(Long PrimaryLanguage)
PrimaryLanguage - 主语言类型:public Long getSampleRate()
public void setSampleRate(Long SampleRate)
SampleRate - 音频采样率:
public String getCodec()
public void setCodec(String Codec)
Codec - 返回音频格式,可取值:wav(默认),mp3,pcmpublic Boolean getEnableSubtitle()
public void setEnableSubtitle(Boolean EnableSubtitle)
EnableSubtitle - 是否开启时间戳功能,默认为false。public Long getSegmentRate()
public void setSegmentRate(Long SegmentRate)
SegmentRate - 断句敏感阈值,默认值为:0,取值范围:[0,1,2]。该值越大越不容易断句,模型会更倾向于仅按照标点符号断句。此参数建议不要随意调整,可能会影响合成效果。public String getEmotionCategory()
public void setEmotionCategory(String EmotionCategory)
EmotionCategory - 控制合成音频的情感,仅支持多情感音色使用。取值: neutral(中性)、sad(悲伤)、happy(高兴)、angry(生气)、fear(恐惧)、news(新闻)、story(故事)、radio(广播)、poetry(诗歌)、call(客服)、sajiao(撒娇)、disgusted(厌恶)、amaze(震惊)、peaceful(平静)、exciting(兴奋)、aojiao(傲娇)、jieshuo(解说)
示例值:neutralpublic Long getEmotionIntensity()
public void setEmotionIntensity(Long EmotionIntensity)
EmotionIntensity - 控制合成音频情感程度,取值范围为[50,200],默认为100;只有EmotionCategory不为空时生效;Copyright © 2025. All rights reserved.