aliyun

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const API_VERSION string = "2018-08-17"
View Source
const DOMAIN string = "filetrans.cn-shanghai.aliyuncs.com"
View Source
const ENDPOINT_NAME string = "cn-shanghai"
View Source
const GET_REQUEST_ACTION string = "GetTaskResult"
View Source
const KEY_APP_KEY string = "appkey"

请求参数key

View Source
const KEY_ENABLE_DISFLUENCY = "enable_disfluency"
View Source
const KEY_ENABLE_UNIFY_POST = "enable_unify_post"
View Source
const KEY_ENABLE_WORDS string = "enable_words"
View Source
const KEY_FILE_LINK string = "file_link"
View Source
const KEY_MAX_SINGLE_SEGMENT_TIME = "max_single_segment_time"
View Source
const KEY_RESULT string = "Result"
View Source
const KEY_STATUS_TEXT string = "StatusText"
View Source
const KEY_TASK string = "Task"

响应参数key

View Source
const KEY_TASK_ID string = "TaskId"
View Source
const KEY_VERSION string = "version"
View Source
const POST_REQUEST_ACTION string = "SubmitTask"
View Source
const PRODUCT string = "nls-filetrans"
View Source
const REGION_ID string = "cn-shanghai"

地域ID,常量内容,请勿改变

View Source
const STATUS_QUEUEING string = "QUEUEING"
View Source
const STATUS_RUNNING string = "RUNNING"
View Source
const STATUS_SUCCESS string = "SUCCESS"

状态值

Variables

This section is empty.

Functions

func NewSpeech

func NewSpeech(accessKeyId, accessKeySecret, appKey string,
	wellKnownNumber map[string]int, wellKnownWord map[string]string) text.ISpeech

Types

type Response

type Response struct {
	TaskId      string  `json:"TaskId"`
	RequestId   string  `json:"RequestId"`
	StatusText  string  `json:"StatusText"`
	BizDuration int64   `json:"BizDuration"`
	SolveTime   int64   `json:"SolveTime"`
	StatusCode  int32   `json:"StatusCode"`
	Result      *Result `json:"Result"`
}

type Result

type Result struct {
	Sentences []*SentencesResult `json:"Sentences"`
	Words     []*WordResult      `json:"Words"`
}

type SentencesResult

type SentencesResult struct {
	EndTime         int64  `json:"EndTime"`
	SilenceDuration int    `json:"SilenceDuration"`
	BeginTime       int64  `json:"BeginTime"`
	Text            string `json:"Text"`
	ChannelId       int    `json:"ChannelId"`
	SpeechRate      int    `json:"SpeechRate"`
	EmotionValue    int    `json:"EmotionValue"`
}

type Speech

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

func (*Speech) BreakSentence added in v1.1.1

func (s *Speech) BreakSentence(channelId int, rsp *Response) (ret []*srt.Srt, err error)

func (*Speech) Equal added in v1.1.2

func (s *Speech) Equal(sw, w string) bool

sw 句子中的词, w单词

func (*Speech) NewBreakSentence added in v1.2.0

func (s *Speech) NewBreakSentence(channelId int, rsp *Response) (ret []*srt.Srt, err error)

func (*Speech) Recognize

func (s *Speech) Recognize(ctx context.Context, fileUri string) (sRet []*srt.Srt, wRet []*srt.Srt, err error)

func (*Speech) Sentence added in v1.1.5

func (s *Speech) Sentence(channelId int, rsp *Response) (ret []*srt.Srt, err error)

func (*Speech) SplitSentence added in v1.2.0

func (s *Speech) SplitSentence(channelId int, rsp *Response) (ret []*srt.Srt)

type WordResult added in v1.1.1

type WordResult struct {
	BeginTime int64  `json:"BeginTime"`
	EndTime   int64  `json:"EndTime"`
	ChannelId int    `json:"ChannelId"`
	Word      string `json:"Word"`
}

Jump to

Keyboard shortcuts

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