tencentcloud-sdk-tts 1.0.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/VERSION +1 -0
- data/lib/tencentcloud-sdk-tts.rb +11 -0
- data/lib/v20190823/client.rb +120 -0
- data/lib/v20190823/models.rb +268 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 55258f362629715e4c61abde85e9299e8d7789c3
|
4
|
+
data.tar.gz: e82f4df200bd56f4330aeeecf6b11e96b8e3fdfe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1c6d80cd25b94fe6a657dd80e13327e98f091fc2cf1bb83d8d8f19c4d3e3df4de739d5a7393535f9d0830fd5381ff0a7bfd80c91f7cdd3defcb33ca63d86abff
|
7
|
+
data.tar.gz: bd78c5921b61ad65d62157692497a65d115830520dd27dfd79e273fc7e91474ef204d8d0807613f35dd0015da4a46ac6754d9dc562305de1a016261d95a3b8d8
|
data/lib/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.200
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require 'json'
|
18
|
+
|
19
|
+
module TencentCloud
|
20
|
+
module Tts
|
21
|
+
module V20190823
|
22
|
+
class Client < TencentCloud::Common::AbstractClient
|
23
|
+
|
24
|
+
def initialize(credential, region, profile = nil)
|
25
|
+
api_version = '2019-08-23'
|
26
|
+
api_endpoint = 'tts.tencentcloudapi.com'
|
27
|
+
sdk_version = 'TTS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
|
28
|
+
super(credential, region, api_version, api_endpoint, sdk_version, profile)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
# 本接口服务对10万字符以内的文本进行语音合成,异步返回音频结果。满足一次性合成较长文本的客户需求,如阅读播报、新闻媒体等场景。
|
33
|
+
|
34
|
+
# <li>支持音频格式:mp3,wav,pcm</li>
|
35
|
+
# <li>支持音频采样率:16000 Hz, 8000 Hz</li>
|
36
|
+
# <li>支持中文普通话、英文、中英文混读、粤语合成</li>
|
37
|
+
# <li>支持语速、音量设置</li>
|
38
|
+
# <li>支持回调或轮询的方式获取结果,结果获取请参考 长文本语音合成结果查询。</li>
|
39
|
+
# <li>长文本语音合成任务完成后,合成音频结果在服务端可保存24小时</li>
|
40
|
+
|
41
|
+
# @param request: Request instance for CreateTtsTask.
|
42
|
+
# @type request: :class:`Tencentcloud::tts::V20190823::CreateTtsTaskRequest`
|
43
|
+
# @rtype: :class:`Tencentcloud::tts::V20190823::CreateTtsTaskResponse`
|
44
|
+
def CreateTtsTask(request)
|
45
|
+
body = send_request('CreateTtsTask', request.serialize)
|
46
|
+
response = JSON.parse(body)
|
47
|
+
if response['Response'].key?('Error') == false
|
48
|
+
model = CreateTtsTaskResponse.new
|
49
|
+
model.deserialize(response['Response'])
|
50
|
+
model
|
51
|
+
else
|
52
|
+
code = response['Response']['Error']['Code']
|
53
|
+
message = response['Response']['Error']['Message']
|
54
|
+
reqid = response['Response']['RequestId']
|
55
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
56
|
+
end
|
57
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
58
|
+
raise e
|
59
|
+
rescue StandardError => e
|
60
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
61
|
+
end
|
62
|
+
|
63
|
+
# 在调用长文本语音合成请求接口后,有回调和轮询两种方式获取识别结果。
|
64
|
+
|
65
|
+
# <li>当采用回调方式时,合成完毕后会将结果通过 POST 请求的形式通知到用户在请求时填写的回调 URL,具体请参见 长文本语音合成结果查询 。</li>
|
66
|
+
# <li>当采用轮询方式时,需要主动提交任务ID来轮询识别结果,共有任务成功、等待、执行中和失败四种结果,具体信息请参见下文说明。</li>
|
67
|
+
|
68
|
+
# @param request: Request instance for DescribeTtsTaskStatus.
|
69
|
+
# @type request: :class:`Tencentcloud::tts::V20190823::DescribeTtsTaskStatusRequest`
|
70
|
+
# @rtype: :class:`Tencentcloud::tts::V20190823::DescribeTtsTaskStatusResponse`
|
71
|
+
def DescribeTtsTaskStatus(request)
|
72
|
+
body = send_request('DescribeTtsTaskStatus', request.serialize)
|
73
|
+
response = JSON.parse(body)
|
74
|
+
if response['Response'].key?('Error') == false
|
75
|
+
model = DescribeTtsTaskStatusResponse.new
|
76
|
+
model.deserialize(response['Response'])
|
77
|
+
model
|
78
|
+
else
|
79
|
+
code = response['Response']['Error']['Code']
|
80
|
+
message = response['Response']['Error']['Message']
|
81
|
+
reqid = response['Response']['RequestId']
|
82
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
83
|
+
end
|
84
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
85
|
+
raise e
|
86
|
+
rescue StandardError => e
|
87
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
88
|
+
end
|
89
|
+
|
90
|
+
# 腾讯云语音合成技术(TTS)可以将任意文本转化为语音,实现让机器和应用张口说话。
|
91
|
+
# 腾讯TTS技术可以应用到很多场景,比如,移动APP语音播报新闻;智能设备语音提醒;依靠网上现有节目或少量录音,快速合成明星语音,降低邀约成本;支持车载导航语音合成的个性化语音播报。
|
92
|
+
# 内测期间免费使用。
|
93
|
+
|
94
|
+
# @param request: Request instance for TextToVoice.
|
95
|
+
# @type request: :class:`Tencentcloud::tts::V20190823::TextToVoiceRequest`
|
96
|
+
# @rtype: :class:`Tencentcloud::tts::V20190823::TextToVoiceResponse`
|
97
|
+
def TextToVoice(request)
|
98
|
+
body = send_request('TextToVoice', request.serialize)
|
99
|
+
response = JSON.parse(body)
|
100
|
+
if response['Response'].key?('Error') == false
|
101
|
+
model = TextToVoiceResponse.new
|
102
|
+
model.deserialize(response['Response'])
|
103
|
+
model
|
104
|
+
else
|
105
|
+
code = response['Response']['Error']['Code']
|
106
|
+
message = response['Response']['Error']['Message']
|
107
|
+
reqid = response['Response']['RequestId']
|
108
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
109
|
+
end
|
110
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
111
|
+
raise e
|
112
|
+
rescue StandardError => e
|
113
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,268 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
module TencentCloud
|
18
|
+
module Tts
|
19
|
+
module V20190823
|
20
|
+
# CreateTtsTask请求参数结构体
|
21
|
+
class CreateTtsTaskRequest < TencentCloud::Common::AbstractModel
|
22
|
+
# @param Text: 合成语音的源文本,按UTF-8编码统一计算,最多支持10万字符
|
23
|
+
# @type Text: String
|
24
|
+
# @param ModelType: 模型类型,1-默认模型。
|
25
|
+
# @type ModelType: Integer
|
26
|
+
# @param Volume: 音量大小,范围:[0,10],分别对应11个等级的音量,默认为0,代表正常音量。没有静音选项。
|
27
|
+
# 输入除以上整数之外的其他参数不生效,按默认值处理。
|
28
|
+
# @type Volume: Float
|
29
|
+
# @param Speed: 语速,范围:[-2,2],分别对应不同语速:<li>-2代表0.6倍</li><li>-1代表0.8倍</li><li>0代表1.0倍(默认)</li><li>1代表1.2倍</li><li>2代表1.5倍</li>如果需要更细化的语速,可以保留小数点后一位,例如0.5 1.1 1.8等。<br>
|
30
|
+
# @type Speed: Float
|
31
|
+
# @param ProjectId: 项目id,用户自定义,默认为0。
|
32
|
+
# @type ProjectId: Integer
|
33
|
+
# @param VoiceType: 标准音色<li>10510000-智逍遥,旁对白阅读风格男声</li><li>1001-智瑜,情感女声</li><li>1002-智聆,通用女声</li><li>1003-智美,客服女声</li><li>1004-智云,通用男声</li><li>1005-智莉,通用女声</li><li>1007-智娜,客服女声</li><li>1008-智琪,客服女声</li><li>1009-智芸,知性女声</li><li>1010-智华,通用男声</li><li>1017-智蓉,情感女声</li><li>1018-智靖,情感男声</li><li>1050-WeJack,英文男声</li><li>1051-WeRose,英文女声</li>精品音色<br>精品音色拟真度更高,价格不同于标准音色,查看[购买指南](https://cloud.tencent.com/product/tts/pricing)<br><li>100510000-智逍遥,旁对白阅读风格男声(精品)</li><li>101001-智瑜,情感女声(精品)</li><li>101002-智聆,通用女声(精品)</li><li>101003-智美,客服女声(精品)</li><li>101004-智云,通用男声(精品)</li><li>101005-智莉,通用女声(精品)</li><li>101006-智言,助手女声</li><li>101007-智娜,客服女声(精品)</li><li>101008-智琪,客服女声(精品)</li><li>101009-智芸,知性女声(精品)</li><li>101010-智华,通用男声(精品)</li><li>101011-智燕,新闻女声</li><li>101012-智丹,新闻女声</li><li>101013-智辉,新闻男声</li><li>101014-智宁,新闻男声</li><li>101015-智萌,男童声</li><li>101016-智甜,女童声</li><li>101017-智蓉,情感女声(精品)</li><li>101018-智靖,情感男声(精品)</li><li>101019-智彤,粤语女声</li><li>101050-WeJack,英文男声(精品)</li><li>101051-WeRose,英文女声(精品)</li>
|
34
|
+
# @type VoiceType: Integer
|
35
|
+
# @param PrimaryLanguage: 主语言类型:<li>1-中文(默认)</li><li>2-英文</li>
|
36
|
+
# @type PrimaryLanguage: Integer
|
37
|
+
# @param SampleRate: 音频采样率:<li>16000:16k(默认)</li><li>8000:8k</li>
|
38
|
+
# @type SampleRate: Integer
|
39
|
+
# @param Codec: 返回音频格式,可取值:mp3(默认),wav,pcm
|
40
|
+
# @type Codec: String
|
41
|
+
# @param CallbackUrl: 回调 URL,用户自行搭建的用于接收识别结果的服务URL。如果用户使用轮询方式获取识别结果,则无需提交该参数。[回调说明](https://cloud.tencent.com/document/product/1073/55746)
|
42
|
+
# @type CallbackUrl: String
|
43
|
+
# @param VoiceoverDialogueSplit: 旁白与对白文本解析,分别合成相应风格(仅适用于旁对白音色),默认 false
|
44
|
+
# @type VoiceoverDialogueSplit: Boolean
|
45
|
+
|
46
|
+
attr_accessor :Text, :ModelType, :Volume, :Speed, :ProjectId, :VoiceType, :PrimaryLanguage, :SampleRate, :Codec, :CallbackUrl, :VoiceoverDialogueSplit
|
47
|
+
|
48
|
+
def initialize(text=nil, modeltype=nil, volume=nil, speed=nil, projectid=nil, voicetype=nil, primarylanguage=nil, samplerate=nil, codec=nil, callbackurl=nil, voiceoverdialoguesplit=nil)
|
49
|
+
@Text = text
|
50
|
+
@ModelType = modeltype
|
51
|
+
@Volume = volume
|
52
|
+
@Speed = speed
|
53
|
+
@ProjectId = projectid
|
54
|
+
@VoiceType = voicetype
|
55
|
+
@PrimaryLanguage = primarylanguage
|
56
|
+
@SampleRate = samplerate
|
57
|
+
@Codec = codec
|
58
|
+
@CallbackUrl = callbackurl
|
59
|
+
@VoiceoverDialogueSplit = voiceoverdialoguesplit
|
60
|
+
end
|
61
|
+
|
62
|
+
def deserialize(params)
|
63
|
+
@Text = params['Text']
|
64
|
+
@ModelType = params['ModelType']
|
65
|
+
@Volume = params['Volume']
|
66
|
+
@Speed = params['Speed']
|
67
|
+
@ProjectId = params['ProjectId']
|
68
|
+
@VoiceType = params['VoiceType']
|
69
|
+
@PrimaryLanguage = params['PrimaryLanguage']
|
70
|
+
@SampleRate = params['SampleRate']
|
71
|
+
@Codec = params['Codec']
|
72
|
+
@CallbackUrl = params['CallbackUrl']
|
73
|
+
@VoiceoverDialogueSplit = params['VoiceoverDialogueSplit']
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
# 异步合成请求的返回数据
|
78
|
+
class CreateTtsTaskRespData < TencentCloud::Common::AbstractModel
|
79
|
+
# @param TaskId: 任务ID,可通过此ID在轮询接口获取合成状态与结果。注意:TaskId数据类型为string
|
80
|
+
# @type TaskId: String
|
81
|
+
|
82
|
+
attr_accessor :TaskId
|
83
|
+
|
84
|
+
def initialize(taskid=nil)
|
85
|
+
@TaskId = taskid
|
86
|
+
end
|
87
|
+
|
88
|
+
def deserialize(params)
|
89
|
+
@TaskId = params['TaskId']
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# CreateTtsTask返回参数结构体
|
94
|
+
class CreateTtsTaskResponse < TencentCloud::Common::AbstractModel
|
95
|
+
# @param Data: 任务 id
|
96
|
+
# @type Data: :class:`Tencentcloud::Tts.v20190823.models.CreateTtsTaskRespData`
|
97
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
98
|
+
# @type RequestId: String
|
99
|
+
|
100
|
+
attr_accessor :Data, :RequestId
|
101
|
+
|
102
|
+
def initialize(data=nil, requestid=nil)
|
103
|
+
@Data = data
|
104
|
+
@RequestId = requestid
|
105
|
+
end
|
106
|
+
|
107
|
+
def deserialize(params)
|
108
|
+
unless params['Data'].nil?
|
109
|
+
@Data = CreateTtsTaskRespData.new
|
110
|
+
@Data.deserialize(params['Data'])
|
111
|
+
end
|
112
|
+
@RequestId = params['RequestId']
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# DescribeTtsTaskStatus请求参数结构体
|
117
|
+
class DescribeTtsTaskStatusRequest < TencentCloud::Common::AbstractModel
|
118
|
+
# @param TaskId: 任务id
|
119
|
+
# @type TaskId: String
|
120
|
+
|
121
|
+
attr_accessor :TaskId
|
122
|
+
|
123
|
+
def initialize(taskid=nil)
|
124
|
+
@TaskId = taskid
|
125
|
+
end
|
126
|
+
|
127
|
+
def deserialize(params)
|
128
|
+
@TaskId = params['TaskId']
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# 获取异步合成结果的返回参数
|
133
|
+
class DescribeTtsTaskStatusRespData < TencentCloud::Common::AbstractModel
|
134
|
+
# @param TaskId: 任务标识。
|
135
|
+
# @type TaskId: String
|
136
|
+
# @param Status: 任务状态码,0:任务等待,1:任务执行中,2:任务成功,3:任务失败。
|
137
|
+
# @type Status: Integer
|
138
|
+
# @param StatusStr: 任务状态,waiting:任务等待,doing:任务执行中,success:任务成功,failed:任务失败。
|
139
|
+
# @type StatusStr: String
|
140
|
+
# @param ResultUrl: 合成音频COS地址(链接有效期1天)。
|
141
|
+
# @type ResultUrl: String
|
142
|
+
# @param ErrorMsg: 失败原因说明。
|
143
|
+
# @type ErrorMsg: String
|
144
|
+
|
145
|
+
attr_accessor :TaskId, :Status, :StatusStr, :ResultUrl, :ErrorMsg
|
146
|
+
|
147
|
+
def initialize(taskid=nil, status=nil, statusstr=nil, resulturl=nil, errormsg=nil)
|
148
|
+
@TaskId = taskid
|
149
|
+
@Status = status
|
150
|
+
@StatusStr = statusstr
|
151
|
+
@ResultUrl = resulturl
|
152
|
+
@ErrorMsg = errormsg
|
153
|
+
end
|
154
|
+
|
155
|
+
def deserialize(params)
|
156
|
+
@TaskId = params['TaskId']
|
157
|
+
@Status = params['Status']
|
158
|
+
@StatusStr = params['StatusStr']
|
159
|
+
@ResultUrl = params['ResultUrl']
|
160
|
+
@ErrorMsg = params['ErrorMsg']
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# DescribeTtsTaskStatus返回参数结构体
|
165
|
+
class DescribeTtsTaskStatusResponse < TencentCloud::Common::AbstractModel
|
166
|
+
# @param Data: 任务状态返回
|
167
|
+
# @type Data: :class:`Tencentcloud::Tts.v20190823.models.DescribeTtsTaskStatusRespData`
|
168
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
169
|
+
# @type RequestId: String
|
170
|
+
|
171
|
+
attr_accessor :Data, :RequestId
|
172
|
+
|
173
|
+
def initialize(data=nil, requestid=nil)
|
174
|
+
@Data = data
|
175
|
+
@RequestId = requestid
|
176
|
+
end
|
177
|
+
|
178
|
+
def deserialize(params)
|
179
|
+
unless params['Data'].nil?
|
180
|
+
@Data = DescribeTtsTaskStatusRespData.new
|
181
|
+
@Data.deserialize(params['Data'])
|
182
|
+
end
|
183
|
+
@RequestId = params['RequestId']
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# TextToVoice请求参数结构体
|
188
|
+
class TextToVoiceRequest < TencentCloud::Common::AbstractModel
|
189
|
+
# @param Text: 合成语音的源文本,按UTF-8编码统一计算。
|
190
|
+
# 中文最大支持150个汉字(全角标点符号算一个汉字);英文最大支持500个字母(半角标点符号算一个字母)。
|
191
|
+
# @type Text: String
|
192
|
+
# @param SessionId: 一次请求对应一个SessionId,会原样返回,建议传入类似于uuid的字符串防止重复。
|
193
|
+
# @type SessionId: String
|
194
|
+
# @param ModelType: 模型类型,1-默认模型。
|
195
|
+
# @type ModelType: Integer
|
196
|
+
# @param Volume: 音量大小,范围:[0,10],分别对应11个等级的音量,默认为0,代表正常音量。没有静音选项。
|
197
|
+
# 输入除以上整数之外的其他参数不生效,按默认值处理。
|
198
|
+
# @type Volume: Float
|
199
|
+
# @param Speed: 语速,范围:[-2,2],分别对应不同语速:<li>-2代表0.6倍</li><li>-1代表0.8倍</li><li>0代表1.0倍(默认)</li><li>1代表1.2倍</li><li>2代表1.5倍</li>如果需要更细化的语速,可以保留小数点后一位,例如0.5 1.1 1.8等。<br>
|
200
|
+
# @type Speed: Float
|
201
|
+
# @param ProjectId: 项目id,用户自定义,默认为0。
|
202
|
+
# @type ProjectId: Integer
|
203
|
+
# @param VoiceType: 标准音色<li>10510000-智逍遥,阅读男声</li><li>1001-智瑜,情感女声</li><li>1002-智聆,通用女声</li><li>1003-智美,客服女声</li><li>1004-智云,通用男声</li><li>1005-智莉,通用女声</li><li>1007-智娜,客服女声</li><li>1008-智琪,客服女声</li><li>1009-智芸,知性女声</li><li>1010-智华,通用男声</li><li>1017-智蓉,情感女声</li><li>1018-智靖,情感男声</li><li>1050-WeJack,英文男声</li><li>1051-WeRose,英文女声</li>精品音色<br>精品音色拟真度更高,价格不同于标准音色,查看[购买指南](https://cloud.tencent.com/product/tts/pricing)<br><li>100510000-智逍遥,阅读男声(精品)</li><li>101001-智瑜,情感女声(精品)</li><li>101002-智聆,通用女声(精品)</li><li>101003-智美,客服女声(精品)</li><li>101004-智云,通用男声(精品)</li><li>101005-智莉,通用女声(精品)</li><li>101006-智言,助手女声</li><li>101007-智娜,客服女声(精品)</li><li>101008-智琪,客服女声(精品)</li><li>101009-智芸,知性女声(精品)</li><li>101010-智华,通用男声(精品)</li><li>101011-智燕,新闻女声</li><li>101012-智丹,新闻女声</li><li>101013-智辉,新闻男声</li><li>101014-智宁,新闻男声</li><li>101015-智萌,男童声</li><li>101016-智甜,女童声</li><li>101017-智蓉,情感女声(精品)</li><li>101018-智靖,情感男声(精品)</li><li>101019-智彤,粤语女声</li><li>101050-WeJack,英文男声(精品)</li><li>101051-WeRose,英文女声(精品)</li>
|
204
|
+
# @type VoiceType: Integer
|
205
|
+
# @param PrimaryLanguage: 主语言类型:<li>1-中文(默认)</li><li>2-英文</li>
|
206
|
+
# @type PrimaryLanguage: Integer
|
207
|
+
# @param SampleRate: 音频采样率:<li>16000:16k(默认)</li><li>8000:8k</li>
|
208
|
+
# @type SampleRate: Integer
|
209
|
+
# @param Codec: 返回音频格式,可取值:wav(默认),mp3,pcm
|
210
|
+
# @type Codec: String
|
211
|
+
|
212
|
+
attr_accessor :Text, :SessionId, :ModelType, :Volume, :Speed, :ProjectId, :VoiceType, :PrimaryLanguage, :SampleRate, :Codec
|
213
|
+
|
214
|
+
def initialize(text=nil, sessionid=nil, modeltype=nil, volume=nil, speed=nil, projectid=nil, voicetype=nil, primarylanguage=nil, samplerate=nil, codec=nil)
|
215
|
+
@Text = text
|
216
|
+
@SessionId = sessionid
|
217
|
+
@ModelType = modeltype
|
218
|
+
@Volume = volume
|
219
|
+
@Speed = speed
|
220
|
+
@ProjectId = projectid
|
221
|
+
@VoiceType = voicetype
|
222
|
+
@PrimaryLanguage = primarylanguage
|
223
|
+
@SampleRate = samplerate
|
224
|
+
@Codec = codec
|
225
|
+
end
|
226
|
+
|
227
|
+
def deserialize(params)
|
228
|
+
@Text = params['Text']
|
229
|
+
@SessionId = params['SessionId']
|
230
|
+
@ModelType = params['ModelType']
|
231
|
+
@Volume = params['Volume']
|
232
|
+
@Speed = params['Speed']
|
233
|
+
@ProjectId = params['ProjectId']
|
234
|
+
@VoiceType = params['VoiceType']
|
235
|
+
@PrimaryLanguage = params['PrimaryLanguage']
|
236
|
+
@SampleRate = params['SampleRate']
|
237
|
+
@Codec = params['Codec']
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
# TextToVoice返回参数结构体
|
242
|
+
class TextToVoiceResponse < TencentCloud::Common::AbstractModel
|
243
|
+
# @param Audio: base64编码的wav/mp3音频数据
|
244
|
+
# @type Audio: String
|
245
|
+
# @param SessionId: 一次请求对应一个SessionId
|
246
|
+
# @type SessionId: String
|
247
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
248
|
+
# @type RequestId: String
|
249
|
+
|
250
|
+
attr_accessor :Audio, :SessionId, :RequestId
|
251
|
+
|
252
|
+
def initialize(audio=nil, sessionid=nil, requestid=nil)
|
253
|
+
@Audio = audio
|
254
|
+
@SessionId = sessionid
|
255
|
+
@RequestId = requestid
|
256
|
+
end
|
257
|
+
|
258
|
+
def deserialize(params)
|
259
|
+
@Audio = params['Audio']
|
260
|
+
@SessionId = params['SessionId']
|
261
|
+
@RequestId = params['RequestId']
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tencentcloud-sdk-tts
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.200
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tencent Cloud
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tencentcloud-sdk-common
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
description: Tencent Cloud Ruby SDK is the official software development kit, which
|
28
|
+
allows Ruby developers to write software that makes use of Tencent Cloud service
|
29
|
+
TTS.
|
30
|
+
email:
|
31
|
+
- tencentcloudapi@tencent.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/VERSION
|
37
|
+
- lib/tencentcloud-sdk-tts.rb
|
38
|
+
- lib/v20190823/client.rb
|
39
|
+
- lib/v20190823/models.rb
|
40
|
+
homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
|
41
|
+
licenses:
|
42
|
+
- Apache-2.0
|
43
|
+
metadata:
|
44
|
+
source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-tts
|
45
|
+
changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 2.6.14
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
65
|
+
summary: Tencent Cloud SDK for Ruby - TTS
|
66
|
+
test_files: []
|