ten

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginTitle   = "rtp-agent.plugins.ten"
	PluginVersion = "v0.1.7"
	PluginPackage = "rtp-agent.plugins.ten"
)

Variables

This section is empty.

Functions

func ModelPath

func ModelPath() (string, error)

ModelPath returns the default TEN model path under the current working directory: resources/models/ten-vad.onnx.

func ModelPathIn

func ModelPathIn(rootDir string) string

ModelPathIn returns the TEN model path under rootDir without consulting the process working directory. Use this with WithModelPath when embedding this library in a service with an explicit application root.

Types

type Plugin

type Plugin struct{}

func (Plugin) DownloadFiles

func (Plugin) DownloadFiles() error

type VAD

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

func NewVAD

func NewVAD(opts ...VADOption) *VAD

func NewVADWithOptions

func NewVADWithOptions(opts ...VADOption) (*VAD, error)

func (*VAD) Capabilities

func (v *VAD) Capabilities() vad.VADCapabilities

func (*VAD) Label

func (v *VAD) Label() string

func (*VAD) Model

func (v *VAD) Model() string

func (*VAD) OnMetricsCollected

func (v *VAD) OnMetricsCollected(handler vad.VADMetricsHandler) func()

func (*VAD) Provider

func (v *VAD) Provider() string

func (*VAD) Stream

func (v *VAD) Stream(ctx context.Context) (vad.VADStream, error)

func (*VAD) UpdateOptions

func (v *VAD) UpdateOptions(options VADOptions)

func (*VAD) UpdateOptionsWith

func (v *VAD) UpdateOptionsWith(opts ...VADOption)

type VADOption

type VADOption func(*VADOptions)

func WithActivationThreshold

func WithActivationThreshold(t float64) VADOption

func WithDeactivationThreshold

func WithDeactivationThreshold(t float64) VADOption

func WithHopSize

func WithHopSize(samples int) VADOption

func WithMaxBufferedSpeech

func WithMaxBufferedSpeech(d float64) VADOption

func WithMinSilenceDuration

func WithMinSilenceDuration(d float64) VADOption

func WithMinSpeechDuration

func WithMinSpeechDuration(d float64) VADOption

func WithModelPath

func WithModelPath(path string) VADOption

WithModelPath configures the TEN ONNX model file used by the native tenvad_native build. Clients that do not want cwd-dependent resource lookup can pass ModelPathIn(appRoot) or any absolute model path.

func WithNativeFallback

func WithNativeFallback() VADOption

func WithNativeLibrary

func WithNativeLibrary(path string) VADOption

func WithPaddingDuration

func WithPaddingDuration(d float64) VADOption

func WithPrefixPaddingDuration

func WithPrefixPaddingDuration(d float64) VADOption

func WithSampleRate

func WithSampleRate(r int) VADOption

func WithUpdateInterval

func WithUpdateInterval(d float64) VADOption

type VADOptions

type VADOptions struct {
	MinSpeechDuration     float64
	MinSilenceDuration    float64
	PrefixPaddingDuration float64
	MaxBufferedSpeech     float64
	ActivationThreshold   float64
	DeactivationThreshold float64
	UpdateInterval        float64
	SampleRate            int
	HopSize               int
	LibraryPath           string
	ModelPath             string
	// contains filtered or unexported fields
}

func DefaultVADOptions

func DefaultVADOptions() VADOptions

Jump to

Keyboard shortcuts

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