Skip to content

Conversation

@renbaoshuo
Copy link

@renbaoshuo renbaoshuo commented Mar 8, 2025

接入步骤

  1. 腾讯云账号在 https://console.cloud.tencent.com/tts 上开通 TTS 服务。
  2. 账号在 https://console.cloud.tencent.com/tts/settings 页面切换至后付费模式。
  3. https://console.cloud.tencent.com/cam/user/create?systemType=SubAccount 页面添加子用户,启用编程访问,并分配 QcloudTTSFullAccessQcloudCOSDataFullControl 权限。
  4. 记录 SecretIdSecretKey
  5. https://console.cloud.tencent.com/cos/bucket 新建存储桶,将 BucketName 和 Region 记录下来。
  6. 在后台系统管理中填入 tts.secretId、tts.secretKey、tts.bucket 和 tts.region(均为先前记录的信息)。
  7. 重启 Hydro 服务。

调用格式

GET /tts

请求参数

参数 类型 说明
text string 需要转语音的文本

返回格式

参数 类型 说明
audioUrl string 音频文件对应的 URL

@luckycv
Copy link
Member

luckycv commented Mar 8, 2025

1.不可以不做权限设置
2.得限制文字长度
3.高频常用语句最好能保存
以上都是避免接口被滥用而产生不必要的费用

@renbaoshuo
Copy link
Author

  1. 不可以不做权限设置

现在做了访问限频,单用户 15 秒内至多生成 3 次语音。

  1. 得限制文字长度

腾讯云的 API 限制生成 150 个字符,因此无需再次计算。

  1. 高频常用语句最好能保存

存储已经做好了。

@luckycv luckycv merged commit 69e3bd0 into master Mar 10, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants