Documentation
¶
Index ¶
- type Context
- func (task *Context) CanTranslate() bool
- func (ctx *Context) Close() error
- func (task *Context) CopyParams()
- func (m *Context) Init(path string, model *schema.Model, gpu int) error
- func (ctx *Context) Is(model *schema.Model) bool
- func (ctx *Context) Language() string
- func (ctx *Context) MarshalJSON() ([]byte, error)
- func (ctx *Context) Result() *schema.Transcription
- func (ctx *Context) SetLanguage(v string) error
- func (ctx *Context) SetTranslate(v bool)
- func (ctx *Context) String() string
- func (task *Context) Transcribe(ctx context.Context, ts time.Duration, samples []float32, segments bool, ...) error
- type NewSegmentFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context is used for running the transcription or translation
func (*Context) CanTranslate ¶
Model is multilingual and can translate
func (*Context) Close ¶
Close the context and release all resources. The context itself can be re-used by calling Init again
func (*Context) MarshalJSON ¶
func (*Context) Result ¶
func (ctx *Context) Result() *schema.Transcription
Return the transcription result
func (*Context) SetLanguage ¶
Set the language. For transcription, this is the language of the audio samples. For translation, this is the language to translate to. If you set this to "auto" then the language will be detected
func (*Context) SetTranslate ¶
Set translate to true or false
func (*Context) Transcribe ¶
func (task *Context) Transcribe(ctx context.Context, ts time.Duration, samples []float32, segments bool, fn NewSegmentFunc) error
Transcribe samples. The samples should be 16KHz float32 samples in a single channel. Appends the transcription to the result, and includes segment data if segments is true.
type NewSegmentFunc ¶
Callback for new segments during the transcription process