speech

package
v1.5.13 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZoneShanghai = "Asia/Shanghai"
)

Variables

View Source
var COOKIE = ""

https://developer.baidu.com/vcast 登录百度账号, 获取 Cookie 信息

Functions

func DeleteEvent

func DeleteEvent(token oauth2.Token, eventID string) error

func DeleteEvents added in v1.5.9

func DeleteEvents(token oauth2.Token, start, end string) error

func FetchYouTubeAudio

func FetchYouTubeAudio(videoID, dst string) error

func FetchYouTubeVideo

func FetchYouTubeVideo(videoID, dst string) error

func HMACSha1

func HMACSha1(key, method, md5, _type, date string, ossHeader []string, resource string) string

func InsertEvent

func InsertEvent(event Event, token oauth2.Token) (err error)

func LanZouRealURL

func LanZouRealURL(download string) (string, error)

func QualityOrder

func QualityOrder(i, j Format) bool

func SpeechToText

func SpeechToText(src string) (result string, err error)

func TextToSpeed

func TextToSpeed(text string, filename string) (err error)

func WithAudioOnly

func WithAudioOnly(format Format) bool

func WithVideoOnly

func WithVideoOnly(format Format) bool

Types

type Context

type Context struct {
	Client map[string]interface{} `json:"client"`
}

type Cron

type Cron struct {
	Minute []int
	Hour   []int
}

type Event

type Event struct {
	TimeAt     *time.Time
	TimeZone   string
	Title      string
	Recurrence Recurrence
	Body       json.RawMessage
	Request    Request
}

type EventDateTime

type EventDateTime struct {
	DateTime time.Time `json:"dateTime,omitempty"`
	TimeZone string    `json:"timeZone,omitempty"`
}

type EventOption

type EventOption interface {
	// contains filtered or unexported methods
}

type FileInfo

type FileInfo struct {
	Icon     string `json:"icon"`
	ID       string `json:"id"`
	Name     string `json:"name_all"`
	Share    string `json:"share"`
	Download string `json:"download"`
}

func FetchLanZouInfo

func FetchLanZouInfo(shareURL, pwd string) ([]FileInfo, error)

type Filter

type Filter func(Format) bool

type Format

type Format struct {
	ITag     int
	Url      string
	Fps      int
	MineType string   // video/webm
	Codecs   []string // ['vp8', 'vorbis']
	Type     string   // video
	SubType  string   // mp4

	VideoCodecs string
	AudioCodecs string

	Res      string
	BitRate  int
	FileSize int64

	DurationMs int64
}

func (*Format) Download

func (f *Format) Download(dst string) error

type Recurrence

type Recurrence []string

func WithCount

func WithCount(c Cron, count int, interval ...int) Recurrence

func WithCron

func WithCron(c Cron, interval ...int) Recurrence

func WithEmpty

func WithEmpty() Recurrence

func WithForever

func WithForever(c Cron, interval ...int) Recurrence

func WithUntil

func WithUntil(c Cron, until time.Time, interval ...int) Recurrence

type Request added in v1.5.9

type Request struct {
	EventID string            `json:"eventID"`
	URL     string            `json:"url"`
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers"`
}

type YouTube

type YouTube struct {
	VideoID string
	// contains filtered or unexported fields
}

func (*YouTube) All

func (tube *YouTube) All() (format []Format, err error)

func (*YouTube) Filter

func (tube *YouTube) Filter(options ...Filter) *YouTube

func (*YouTube) First

func (tube *YouTube) First() (format Format, err error)

func (*YouTube) IndexOf

func (tube *YouTube) IndexOf(i int) (format Format, err error)

func (*YouTube) Last

func (tube *YouTube) Last() (format Format, err error)

func (*YouTube) OrderBy

func (tube *YouTube) OrderBy(order func(i, j Format) bool) *YouTube

Jump to

Keyboard shortcuts

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