Documentation
¶
Index ¶
- Constants
- func ModelPath() (string, error)
- func ModelPathIn(rootDir string) string
- type Plugin
- type VAD
- func (v *VAD) Capabilities() vad.VADCapabilities
- func (v *VAD) Label() string
- func (v *VAD) Model() string
- func (v *VAD) OnMetricsCollected(handler vad.VADMetricsHandler) func()
- func (v *VAD) Provider() string
- func (v *VAD) Stream(ctx context.Context) (vad.VADStream, error)
- func (v *VAD) UpdateOptions(options VADOptions)
- func (v *VAD) UpdateOptionsWith(opts ...VADOption)
- type VADOption
- func WithActivationThreshold(t float64) VADOption
- func WithDeactivationThreshold(t float64) VADOption
- func WithHopSize(samples int) VADOption
- func WithMaxBufferedSpeech(d float64) VADOption
- func WithMinSilenceDuration(d float64) VADOption
- func WithMinSpeechDuration(d float64) VADOption
- func WithModelPath(path string) VADOption
- func WithNativeFallback() VADOption
- func WithNativeLibrary(path string) VADOption
- func WithPaddingDuration(d float64) VADOption
- func WithPrefixPaddingDuration(d float64) VADOption
- func WithSampleRate(r int) VADOption
- func WithUpdateInterval(d float64) VADOption
- type VADOptions
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 ¶
ModelPath returns the default TEN model path under the current working directory: resources/models/ten-vad.onnx.
func ModelPathIn ¶
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 VAD ¶
type VAD struct {
// contains filtered or unexported fields
}
func NewVADWithOptions ¶
func (*VAD) Capabilities ¶
func (v *VAD) Capabilities() vad.VADCapabilities
func (*VAD) OnMetricsCollected ¶
func (v *VAD) OnMetricsCollected(handler vad.VADMetricsHandler) func()
func (*VAD) UpdateOptions ¶
func (v *VAD) UpdateOptions(options VADOptions)
func (*VAD) UpdateOptionsWith ¶
type VADOption ¶
type VADOption func(*VADOptions)
func WithActivationThreshold ¶
func WithHopSize ¶
func WithMaxBufferedSpeech ¶
func WithMinSilenceDuration ¶
func WithMinSpeechDuration ¶
func WithModelPath ¶
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 WithPaddingDuration ¶
func WithSampleRate ¶
func WithUpdateInterval ¶
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
Click to show internal directories.
Click to hide internal directories.