pyopenwakeword

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BatchSize       = 1
	AutofillSeconds = 8
	MaxSeconds      = 10
	SampleRate      = 16000

	SamplesPerChunk = 1280
	MsPerChunk      = SamplesPerChunk / SampleRate
	MelsPerSecond   = 97
	MaxMels         = MaxSeconds * MelsPerSecond
	MelSamples      = 1760
	NumMels         = 32
	EmbFeatures     = 76
	EmbStep         = 8
	MaxEmb          = MaxSeconds * EmbStep
	WWFeatures      = 96
)

Constants of the openWakeWord pipeline, 80 ms chunks at 16 kHz through mel, embedding and classifier windows

View Source
const (
	ModelOkayNabu   = "okay_nabu"
	ModelHeyJarvis  = "hey_jarvis"
	ModelHeyMycroft = "hey_mycroft"
	ModelAlexa      = "alexa"
	ModelHeyRhasspy = "hey_rhasspy"
)

Built in openWakeWord model names

Variables

This section is empty.

Functions

func GetPlatform

func GetPlatform() (string, bool)

Library directory name for this host, false where no tensorflowlite_c build exists

Types

type Module

type Module struct{ Dir string }

The imported pyopen_wakeword package rooted at its directory

func Import

func Import(dir string) *Module

Imports the package unpacked at dir

func (*Module) FeaturesFromBuiltin

func (m *Module) FeaturesFromBuiltin(modelsDir, libtensorflowliteCPath *string) (*OpenWakeWordFeatures, error)

Loads the shared feature models from the models directory, the package one when modelsDir is nil

func (*Module) FromBuiltin

func (m *Module) FromBuiltin(model string, modelsDir, libtensorflowliteCPath *string) (*OpenWakeWord, error)

Loads a built in classifier by name from the models directory, the package one when modelsDir is nil

func (*Module) FromModel

func (m *Module) FromModel(modelPath string, libtensorflowliteCPath *string) (*OpenWakeWord, error)

Loads a classifier from a model file, finding the bundled library when no library path is given

func (*Module) LoadLibrary

func (m *Module) LoadLibrary() error

Loads the tensorflowlite_c library the package carries and binds the functions the models call

type OpenWakeWord

type OpenWakeWord struct {
	*TfLiteWakeWord

	TfliteModel string
	// contains filtered or unexported fields
}

One wake word classifier over rolling embedding windows

func (*OpenWakeWord) Close

func (w *OpenWakeWord) Close()

Releases the interpreter and the model

func (*OpenWakeWord) ID

func (w *OpenWakeWord) ID() string

The model name, its file stem

func (*OpenWakeWord) ProcessStreaming

func (w *OpenWakeWord) ProcessStreaming(embeddings []float32, yield func(float32) bool) error

Feeds embedding windows and yields one probability per classifier window that became ready

func (*OpenWakeWord) Reset

func (w *OpenWakeWord) Reset()

Clears the rolling embeddings so earlier audio cannot score

type OpenWakeWordFeatures

type OpenWakeWordFeatures struct {
	*TfLiteWakeWord
	MelPath string
	EmbPath string
	// contains filtered or unexported fields
}

Turns streamed audio into embedding windows through the mel and embedding models

func (*OpenWakeWordFeatures) Close

func (f *OpenWakeWordFeatures) Close()

Releases both interpreters and both models

func (*OpenWakeWordFeatures) ProcessStreaming

func (f *OpenWakeWordFeatures) ProcessStreaming(audioChunk []byte, yield func([]float32) bool) error

Feeds 16 bit native endian audio and yields each embedding window group that became ready

func (*OpenWakeWordFeatures) Reset

func (f *OpenWakeWordFeatures) Reset()

Clears the rolling audio and mel buffers back to the freshly built state

type PyError

type PyError struct{ Class, Msg string }

A builtin Python exception the package raises, named by its class

func (*PyError) Error

func (e *PyError) Error() string

type TfLiteWakeWord

type TfLiteWakeWord struct {
	LibtensorflowliteCPath string
	// contains filtered or unexported fields
}

The base of both wake word classes, the resolved library path and the bound library

Jump to

Keyboard shortcuts

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