v20180522

package
v0.0.0-...-1480282 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "2018-05-22"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

func (*Client) SentenceRecognition

func (c *Client) SentenceRecognition(request *SentenceRecognitionRequest) (response *SentenceRecognitionResponse, err error)

识别60s内的短语音,当音频放在请求body中传输时整个请求大小不能超过1M,当音频以url方式传输时,音频时长不可超过60s。

func (*Client) TextToVoice

func (c *Client) TextToVoice(request *TextToVoiceRequest) (response *TextToVoiceResponse, err error)

腾讯云语音合成技术(TTS)可以将任意文本转化为语音,实现让机器和应用张口说话。 腾讯TTS技术可以应用到很多场景,比如,移动APP语音播报新闻;智能设备语音提醒;依靠网上现有节目或少量录音,快速合成明星语音,降低邀约成本;支持车载导航语音合成的个性化语音播报。 内测期间免费使用。

type SentenceRecognitionRequest

type SentenceRecognitionRequest struct {
	*tchttp.BaseRequest
	// 腾讯云项目 ID,可填 0,总长度不超过 1024 字节。
	ProjectId *uint64 `json:"ProjectId" name:"ProjectId"`
	// 子服务类型。0:离线语音识别。1:实时流式识别,2,一句话识别。
	SubServiceType *uint64 `json:"SubServiceType" name:"SubServiceType"`
	// 引擎类型。8k:电话 8k 通用模型;16k:16k 通用模型。
	EngSerViceType *string `json:"EngSerViceType" name:"EngSerViceType"`
	// 语音数据来源。0:语音 URL;1:语音数据(post body)。
	SourceType *uint64 `json:"SourceType" name:"SourceType"`
	// 识别音频的音频格式(支持mp3,wav)。
	VoiceFormat *string `json:"VoiceFormat" name:"VoiceFormat"`
	// 用户端对此任务的唯一标识,用户自助生成,用于用户查找识别结果。
	UsrAudioKey *string `json:"UsrAudioKey" name:"UsrAudioKey"`
	// 语音 URL,公网可下载。当 SourceType 值为 0 时须填写该字段,为 1 时不填;URL 的长度大于 0,小于 2048,需进行urlencode编码。音频时间长度要小于60s。
	Url *string `json:"Url" name:"Url"`
	// 语音数据,当SourceType 值为1时必须填写,为0可不写。要base64编码。音频数据要小于900k。
	Data *string `json:"Data" name:"Data"`
	// 数据长度,当 SourceType 值为1时必须填写,为0可不写。
	DataLen *int64 `json:"DataLen" name:"DataLen"`
}

func NewSentenceRecognitionRequest

func NewSentenceRecognitionRequest() (request *SentenceRecognitionRequest)

func (*SentenceRecognitionRequest) FromJsonString

func (r *SentenceRecognitionRequest) FromJsonString(s string) error

func (*SentenceRecognitionRequest) ToJsonString

func (r *SentenceRecognitionRequest) ToJsonString() string

type SentenceRecognitionResponse

type SentenceRecognitionResponse struct {
	*tchttp.BaseResponse
	Response *struct {
		// 识别结果。
		Result *string `json:"Result" name:"Result"`
		// 唯一请求ID,每次请求都会返回。定位问题时需要提供该次请求的RequestId。
		RequestId *string `json:"RequestId" name:"RequestId"`
	} `json:"Response"`
}

func NewSentenceRecognitionResponse

func NewSentenceRecognitionResponse() (response *SentenceRecognitionResponse)

func (*SentenceRecognitionResponse) FromJsonString

func (r *SentenceRecognitionResponse) FromJsonString(s string) error

func (*SentenceRecognitionResponse) ToJsonString

func (r *SentenceRecognitionResponse) ToJsonString() string

type TextToVoiceRequest

type TextToVoiceRequest struct {
	*tchttp.BaseRequest
	// 合成语音的源文本
	Text *string `json:"Text" name:"Text"`
	// 一次请求对应一个SessionId,会原样返回,建议传入类似于uuid的字符串防止重复
	SessionId *string `json:"SessionId" name:"SessionId"`
	// 模型类型,1-默认模型
	ModelType *int64 `json:"ModelType" name:"ModelType"`
	// 音量大小,暂仅支持默认值1
	Volume *float64 `json:"Volume" name:"Volume"`
	// 语速,暂仅支持默认值1
	Speed *float64 `json:"Speed" name:"Speed"`
	// 用户自定义项目id,默认为0
	ProjectId *int64 `json:"ProjectId" name:"ProjectId"`
	// 音色,1-默认音色
	VoiceType *int64 `json:"VoiceType" name:"VoiceType"`
	// 主语言类型<li>1-中文(包括粤语),最大300字符</li><li>2-英文,最大支持600字符</li>
	PrimaryLanguage *uint64 `json:"PrimaryLanguage" name:"PrimaryLanguage"`
	// 音频采样率:暂仅支持16k
	SampleRate *uint64 `json:"SampleRate" name:"SampleRate"`
}

func NewTextToVoiceRequest

func NewTextToVoiceRequest() (request *TextToVoiceRequest)

func (*TextToVoiceRequest) FromJsonString

func (r *TextToVoiceRequest) FromJsonString(s string) error

func (*TextToVoiceRequest) ToJsonString

func (r *TextToVoiceRequest) ToJsonString() string

type TextToVoiceResponse

type TextToVoiceResponse struct {
	*tchttp.BaseResponse
	Response *struct {
		// base编码的wav音频
		Audio *string `json:"Audio" name:"Audio"`
		// 一次请求对应一个SessionId
		SessionId *string `json:"SessionId" name:"SessionId"`
		// 唯一请求ID,每次请求都会返回。定位问题时需要提供该次请求的RequestId。
		RequestId *string `json:"RequestId" name:"RequestId"`
	} `json:"Response"`
}

func NewTextToVoiceResponse

func NewTextToVoiceResponse() (response *TextToVoiceResponse)

func (*TextToVoiceResponse) FromJsonString

func (r *TextToVoiceResponse) FromJsonString(s string) error

func (*TextToVoiceResponse) ToJsonString

func (r *TextToVoiceResponse) ToJsonString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL