|
|
@@ -82,19 +82,14 @@ void CSpeech::TXSpeak(std::string content)
|
|
|
// 报 "unable to get local issuer certificate" / "Problem with the SSL CA cert" 时,
|
|
|
// 设置 TTS_CA_FILE 指向 cacert.pem(可从 https://curl.se/ca/cacert.pem 下载)。
|
|
|
const std::string ca_file = "";
|
|
|
- if (!ca_file.empty())
|
|
|
- {
|
|
|
- client.SetCaFile(ca_file);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // 本地 demo 默认跳过证书校验,便于先跑通业务逻辑;上生产前一定要开回去。
|
|
|
- client.SetVerifyPeer(false);
|
|
|
- }
|
|
|
+ if (!ca_file.empty()) client.SetCaFile(ca_file);
|
|
|
+ // 只有在上面两步都不行、且仅本地调试时,才打开下面这行跳过校验(生产禁用):
|
|
|
+ // client.SetVerifyPeer(false);
|
|
|
|
|
|
// 必做:把 voice_type 换成你选中的「多情感音色」ID
|
|
|
// 音色列表:https://cloud.tencent.com/document/product/1073/92668
|
|
|
- const int kMyVoiceType = 101026;
|
|
|
+ // 音色试用:https://cloud.tencent.com/product/tts
|
|
|
+ const int kMyVoiceType = 101055;
|
|
|
|
|
|
const std::string text = content;
|
|
|
|
|
|
@@ -194,6 +189,7 @@ void CSpeech::TXSpeak(std::string content)
|
|
|
sopt.emotion_category = "story";
|
|
|
sopt.emotion_intensity = 120;
|
|
|
sopt.speed = 0.0f;
|
|
|
+ sopt.volume = 10.0f;
|
|
|
sopt.ca_file = ca_file; // 上面从 TTS_CA_FILE 读到的,空则走默认查找
|
|
|
|
|
|
PcmPlayer player;
|