Documentation
¶
Index ¶
- func WriteSegmentSrt(w io.Writer, seg *schema.Segment)
- func WriteSegmentText(w io.Writer, seg *schema.Segment)
- func WriteSegmentVtt(w io.Writer, seg *schema.Segment)
- type Context
- func (task *Context) CanTranslate() bool
- func (ctx *Context) Close() error
- func (task *Context) CopyParams()
- func (ctx *Context) Diarize() bool
- 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) SetDiarize(v bool)
- 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, fn NewSegmentFunc) error
- func (ctx *Context) Translate() bool
- type NewSegmentFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) SetDiarize ¶ added in v0.0.15
Set diarize flag
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, 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 the new segment function is not nil
type NewSegmentFunc ¶
Callback for new segments during the transcription process