larkspeech_to_text

package
v3.0.21 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileConfig

type FileConfig struct {
	FileId     *string `json:"file_id,omitempty"`     // 仅包含字母数字和下划线的 16 位字符串作为文件的标识,用户生成
	Format     *string `json:"format,omitempty"`      // 语音格式,目前仅支持:pcm
	EngineType *string `json:"engine_type,omitempty"` // 引擎类型,目前仅支持:16k_auto 中英混合
}

type FileConfigBuilder

type FileConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewFileConfigBuilder

func NewFileConfigBuilder() *FileConfigBuilder

func (*FileConfigBuilder) Build

func (builder *FileConfigBuilder) Build() *FileConfig

func (*FileConfigBuilder) EngineType

func (builder *FileConfigBuilder) EngineType(engineType string) *FileConfigBuilder

引擎类型,目前仅支持:16k_auto 中英混合

示例值:16k_auto

func (*FileConfigBuilder) FileId

func (builder *FileConfigBuilder) FileId(fileId string) *FileConfigBuilder

仅包含字母数字和下划线的 16 位字符串作为文件的标识,用户生成

示例值:qwe12dd34567890w

func (*FileConfigBuilder) Format

func (builder *FileConfigBuilder) Format(format string) *FileConfigBuilder

语音格式,目前仅支持:pcm

示例值:pcm

type FileRecognizeSpeechPathReqBodyBuilder

type FileRecognizeSpeechPathReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewFileRecognizeSpeechPathReqBodyBuilder

func NewFileRecognizeSpeechPathReqBodyBuilder() *FileRecognizeSpeechPathReqBodyBuilder

func (*FileRecognizeSpeechPathReqBodyBuilder) Build

func (*FileRecognizeSpeechPathReqBodyBuilder) Config

配置属性

示例值:

func (*FileRecognizeSpeechPathReqBodyBuilder) Speech

语音资源

示例值:

type FileRecognizeSpeechReq

type FileRecognizeSpeechReq struct {
	Body *FileRecognizeSpeechReqBody `body:""`
	// contains filtered or unexported fields
}

type FileRecognizeSpeechReqBody

type FileRecognizeSpeechReqBody struct {
	Speech *Speech     `json:"speech,omitempty"` // 语音资源
	Config *FileConfig `json:"config,omitempty"` // 配置属性
}

type FileRecognizeSpeechReqBodyBuilder

type FileRecognizeSpeechReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewFileRecognizeSpeechReqBodyBuilder

func NewFileRecognizeSpeechReqBodyBuilder() *FileRecognizeSpeechReqBodyBuilder

func (*FileRecognizeSpeechReqBodyBuilder) Build

func (*FileRecognizeSpeechReqBodyBuilder) Config

配置属性

示例值:

func (*FileRecognizeSpeechReqBodyBuilder) Speech

语音资源

示例值:

type FileRecognizeSpeechReqBuilder

type FileRecognizeSpeechReqBuilder struct {
	// contains filtered or unexported fields
}

func NewFileRecognizeSpeechReqBuilder

func NewFileRecognizeSpeechReqBuilder() *FileRecognizeSpeechReqBuilder

func (*FileRecognizeSpeechReqBuilder) Body

语音文件识别接口,上传整段语音文件进行一次性识别。接口适合 60 秒以内音频识别

func (*FileRecognizeSpeechReqBuilder) Build

type FileRecognizeSpeechResp

type FileRecognizeSpeechResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *FileRecognizeSpeechRespData `json:"data"` // 业务数据
}

func (*FileRecognizeSpeechResp) Success

func (resp *FileRecognizeSpeechResp) Success() bool

type FileRecognizeSpeechRespData

type FileRecognizeSpeechRespData struct {
	RecognitionText *string `json:"recognition_text,omitempty"` // 语音识别后的文本信息
}

type Speech

type Speech struct {
	Speech    *string `json:"speech,omitempty"`     // pcm格式音频文件(文件识别)或音频分片(流式识别)经base64编码后的内容
	SpeechKey *string `json:"speech_key,omitempty"` // 上传到 drive 存储平台后获取到的 key (暂不支持)
}

type SpeechBuilder

type SpeechBuilder struct {
	// contains filtered or unexported fields
}

func NewSpeechBuilder

func NewSpeechBuilder() *SpeechBuilder

func (*SpeechBuilder) Build

func (builder *SpeechBuilder) Build() *Speech

func (*SpeechBuilder) Speech

func (builder *SpeechBuilder) Speech(speech string) *SpeechBuilder

pcm格式音频文件(文件识别)或音频分片(流式识别)经base64编码后的内容

示例值:PdmrfE267Cd/Z9KpmNFh71A2PSJZxSp7+8upCg==

func (*SpeechBuilder) SpeechKey

func (builder *SpeechBuilder) SpeechKey(speechKey string) *SpeechBuilder

上传到 drive 存储平台后获取到的 key (暂不支持)

示例值:

type SpeechToTextService

type SpeechToTextService struct {
	Speech *speech // 语音识别
	// contains filtered or unexported fields
}

func NewService

func NewService(config *larkcore.Config) *SpeechToTextService

type StreamConfig

type StreamConfig struct {
	StreamId   *string `json:"stream_id,omitempty"`   // 仅包含字母数字和下划线的 16 位字符串作为同一数据流的标识,用户生成
	SequenceId *int    `json:"sequence_id,omitempty"` // 数据流分片的序号,序号从 0 开始,每次请求递增 1
	Action     *int    `json:"action,omitempty"`      // 数据流标记:1 首包,2 正常结束,等待结果返回,3 中断数据流不返回最终结果
	Format     *string `json:"format,omitempty"`      // 语音格式,目前仅支持:pcm
	EngineType *string `json:"engine_type,omitempty"` // 引擎类型,目前仅支持:16k_auto 中英混合
}

type StreamConfigBuilder

type StreamConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewStreamConfigBuilder

func NewStreamConfigBuilder() *StreamConfigBuilder

func (*StreamConfigBuilder) Action

func (builder *StreamConfigBuilder) Action(action int) *StreamConfigBuilder

数据流标记:1 首包,2 正常结束,等待结果返回,3 中断数据流不返回最终结果

示例值:1

func (*StreamConfigBuilder) Build

func (builder *StreamConfigBuilder) Build() *StreamConfig

func (*StreamConfigBuilder) EngineType

func (builder *StreamConfigBuilder) EngineType(engineType string) *StreamConfigBuilder

引擎类型,目前仅支持:16k_auto 中英混合

示例值:16k_auto

func (*StreamConfigBuilder) Format

func (builder *StreamConfigBuilder) Format(format string) *StreamConfigBuilder

语音格式,目前仅支持:pcm

示例值:pcm

func (*StreamConfigBuilder) SequenceId

func (builder *StreamConfigBuilder) SequenceId(sequenceId int) *StreamConfigBuilder

数据流分片的序号,序号从 0 开始,每次请求递增 1

示例值:1

func (*StreamConfigBuilder) StreamId

func (builder *StreamConfigBuilder) StreamId(streamId string) *StreamConfigBuilder

仅包含字母数字和下划线的 16 位字符串作为同一数据流的标识,用户生成

示例值:asd1234567890ddd

type StreamRecognizeSpeechPathReqBodyBuilder

type StreamRecognizeSpeechPathReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewStreamRecognizeSpeechPathReqBodyBuilder

func NewStreamRecognizeSpeechPathReqBodyBuilder() *StreamRecognizeSpeechPathReqBodyBuilder

func (*StreamRecognizeSpeechPathReqBodyBuilder) Build

func (*StreamRecognizeSpeechPathReqBodyBuilder) Config

配置属性

示例值:

func (*StreamRecognizeSpeechPathReqBodyBuilder) Speech

语音资源

示例值:

type StreamRecognizeSpeechReq

type StreamRecognizeSpeechReq struct {
	Body *StreamRecognizeSpeechReqBody `body:""`
	// contains filtered or unexported fields
}

type StreamRecognizeSpeechReqBody

type StreamRecognizeSpeechReqBody struct {
	Speech *Speech       `json:"speech,omitempty"` // 语音资源
	Config *StreamConfig `json:"config,omitempty"` // 配置属性
}

type StreamRecognizeSpeechReqBodyBuilder

type StreamRecognizeSpeechReqBodyBuilder struct {
	// contains filtered or unexported fields
}

func NewStreamRecognizeSpeechReqBodyBuilder

func NewStreamRecognizeSpeechReqBodyBuilder() *StreamRecognizeSpeechReqBodyBuilder

func (*StreamRecognizeSpeechReqBodyBuilder) Build

func (*StreamRecognizeSpeechReqBodyBuilder) Config

配置属性

示例值:

func (*StreamRecognizeSpeechReqBodyBuilder) Speech

语音资源

示例值:

type StreamRecognizeSpeechReqBuilder

type StreamRecognizeSpeechReqBuilder struct {
	// contains filtered or unexported fields
}

func NewStreamRecognizeSpeechReqBuilder

func NewStreamRecognizeSpeechReqBuilder() *StreamRecognizeSpeechReqBuilder

func (*StreamRecognizeSpeechReqBuilder) Body

语音流式接口,将整个音频文件分片进行传入模型。能够实时返回数据。建议每个音频分片的大小为 100-200ms

func (*StreamRecognizeSpeechReqBuilder) Build

type StreamRecognizeSpeechResp

type StreamRecognizeSpeechResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *StreamRecognizeSpeechRespData `json:"data"` // 业务数据
}

func (*StreamRecognizeSpeechResp) Success

func (resp *StreamRecognizeSpeechResp) Success() bool

type StreamRecognizeSpeechRespData

type StreamRecognizeSpeechRespData struct {
	StreamId        *string `json:"stream_id,omitempty"`        // 16 位 String 随机串作为同一数据流的标识
	SequenceId      *int    `json:"sequence_id,omitempty"`      // 数据流分片的序号,序号从 0 开始,每次请求递增 1
	RecognitionText *string `json:"recognition_text,omitempty"` // 语音流识别后的文本信息
}

Jump to

Keyboard shortcuts

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