v20190614

package
v3.0.71+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "2019-06-14"

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)

Deprecated

func (*Client) SentenceRecognition

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

识别60s内的短语音。当音频文件通过请求中body内容上传时,请求大小不能超过600KB;当音频以url方式传输时,音频时长不可超过60s。所有请求参数放在POST请求的body中,编码类型采用采用x-www-form-urlencoded,参数进行urlencode编码后传输。现暂只支持中文普通话识别,支持识别8k16bit和16k16bit的mp3或者wav音频。

type SentenceRecognitionRequest

type SentenceRecognitionRequest struct {
	*tchttp.BaseRequest

	// 腾讯云项目 ID,可填 0,总长度不超过 1024 字节。
	ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"`

	// 子服务类型。2: 一句话识别。
	SubServiceType *uint64 `json:"SubServiceType,omitempty" name:"SubServiceType"`

	// 引擎类型。8k:电话 8k 通用模型;16k:16k 通用模型。只支持单声道音频识别。
	EngSerViceType *string `json:"EngSerViceType,omitempty" name:"EngSerViceType"`

	// 语音数据来源。0:语音 URL;1:语音数据(post body)。
	SourceType *uint64 `json:"SourceType,omitempty" name:"SourceType"`

	// 识别音频的音频格式(支持mp3,wav)。
	VoiceFormat *string `json:"VoiceFormat,omitempty" name:"VoiceFormat"`

	// 用户端对此任务的唯一标识,用户自助生成,用于用户查找识别结果。
	UsrAudioKey *string `json:"UsrAudioKey,omitempty" name:"UsrAudioKey"`

	// 语音 URL,公网可下载。当 SourceType 值为 0 时须填写该字段,为 1 时不填;URL 的长度大于 0,小于 2048,需进行urlencode编码。音频时间长度要小于60s。
	Url *string `json:"Url,omitempty" name:"Url"`

	// 语音数据,当SourceType 值为1时必须填写,当SourceType 值为0可不写。要使用base64编码(采用python语言时注意读取文件应该为string而不是byte,以byte格式读取后要decode()。编码后的数据不可带有回车换行符)。音频数据要小于600kB。
	Data *string `json:"Data,omitempty" name:"Data"`

	// 数据长度,当 SourceType 值为1时必须填写,当 SourceType 值为0可不写(此数据长度为数据未进行base64编码时的数据长度)。
	DataLen *int64 `json:"DataLen,omitempty" 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,omitempty" name:"Result"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" 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

Jump to

Keyboard shortcuts

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