whisper

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The path to the GGML model file to use.
	ModelFile string
	// The number of system threads to use to perform the transcription.
	NumThreads int
	// Whether or not past transcription should be used as prompt.
	NoContext bool
	// 512 = a bit more than 10s. Use multiples of 64. Results in a speedup of 3x at 512, b/c whisper was tuned for 30s chunks. See: https://github.com/ggerganov/whisper.cpp/pull/141
	// TODO: tests, validation
	AudioContext int
	// Whether or not to print progress to stdout (default false).
	PrintProgress bool
	// Language to use (defaults to autodetection).
	Language string
	// Whether or not to generate a single segment (default false).
	SingleSegment bool
}

func (Config) IsValid

func (c Config) IsValid() error

type Context

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

func NewContext

func NewContext(cfg Config) (*Context, error)

func (*Context) Destroy

func (c *Context) Destroy() error

func (*Context) Transcribe

func (c *Context) Transcribe(samples []float32) ([]transcribe.Segment, string, error)

Jump to

Keyboard shortcuts

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