transcribe

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLanguage = "en"

Variables

This section is empty.

Functions

This section is empty.

Types

type Segment

type Segment struct {
	Text    string
	StartTS int64
	EndTS   int64
}

type TextCompactOptions added in v0.1.1

type TextCompactOptions struct {
	SilenceThresholdMs   int
	MaxSegmentDurationMs int
}

func (*TextCompactOptions) IsEmpty added in v0.1.1

func (o *TextCompactOptions) IsEmpty() bool

func (*TextCompactOptions) SetDefaults added in v0.1.1

func (o *TextCompactOptions) SetDefaults()

type TextOptions added in v0.1.1

type TextOptions struct {
	CompactOptions TextCompactOptions
}

func (*TextOptions) FromEnv added in v0.1.1

func (o *TextOptions) FromEnv()

func (*TextOptions) FromMap added in v0.1.1

func (o *TextOptions) FromMap(m map[string]any)

func (*TextOptions) IsEmpty added in v0.1.1

func (o *TextOptions) IsEmpty() bool

func (*TextOptions) IsValid added in v0.1.1

func (o *TextOptions) IsValid() error

func (*TextOptions) SetDefaults added in v0.1.1

func (o *TextOptions) SetDefaults()

func (*TextOptions) ToEnv added in v0.1.1

func (o *TextOptions) ToEnv() []string

func (*TextOptions) ToMap added in v0.1.1

func (o *TextOptions) ToMap() map[string]any

type TrackTranscription

type TrackTranscription struct {
	Speaker  string
	Language string
	Segments []Segment
}

type Transcriber

type Transcriber interface {
	Transcribe(samples []float32) ([]Segment, string, error)
	Destroy() error
}

type Transcription

type Transcription []TrackTranscription

func (Transcription) Language added in v0.1.4

func (tr Transcription) Language() string

func (Transcription) Text

func (t Transcription) Text(w io.Writer, opts TextOptions) error

func (Transcription) WebVTT

func (t Transcription) WebVTT(w io.Writer, opts WebVTTOptions) error

type WebVTTOptions

type WebVTTOptions struct {
	OmitSpeaker bool
}

func (*WebVTTOptions) FromEnv added in v0.1.1

func (o *WebVTTOptions) FromEnv()

func (*WebVTTOptions) FromMap added in v0.1.1

func (o *WebVTTOptions) FromMap(m map[string]any)

func (*WebVTTOptions) IsEmpty added in v0.1.1

func (o *WebVTTOptions) IsEmpty() bool

func (*WebVTTOptions) IsValid added in v0.1.1

func (o *WebVTTOptions) IsValid() error

func (*WebVTTOptions) SetDefaults added in v0.1.1

func (o *WebVTTOptions) SetDefaults()

func (*WebVTTOptions) ToEnv added in v0.1.1

func (o *WebVTTOptions) ToEnv() []string

func (*WebVTTOptions) ToMap added in v0.1.1

func (o *WebVTTOptions) ToMap() map[string]any

Jump to

Keyboard shortcuts

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