libSDRForge
Loading...
Searching...
No Matches
sdrforge.weather.vosk_native.VoskNativeAdapter Class Reference

Offline speech recognizer backed by libvosk's stable C API. More...

Public Member Functions

None __init__ (self, str|Path model_path, str|Path|None library_path=None)
 Provide init behavior.
None close (self)
 Provide close behavior.
Self __enter__ (self)
 Provide enter behavior.
None __exit__ (self, *object _)
 Provide exit behavior.
str transcribe (self, np.ndarray pcm, int sample_rate)
 Provide transcribe behavior.

Static Protected Member Functions

None _configure (ctypes.CDLL lib)

Protected Attributes

 _lib = lib
 _model = model

Detailed Description

Offline speech recognizer backed by libvosk's stable C API.

Constructor & Destructor Documentation

◆ __init__()

None sdrforge.weather.vosk_native.VoskNativeAdapter.__init__ ( self,
str | Path model_path,
str | Path | None library_path = None )

Provide init behavior.

Parameters
selfThe current instance.
model_pathThe model path value.
library_pathThe library path value.

Member Function Documentation

◆ __enter__()

Self sdrforge.weather.vosk_native.VoskNativeAdapter.__enter__ ( self)

Provide enter behavior.

Parameters
selfThe current instance.
Returns
The operation result.

◆ __exit__()

None sdrforge.weather.vosk_native.VoskNativeAdapter.__exit__ ( self,
*object _ )

Provide exit behavior.

Parameters
selfThe current instance.
_The value.

◆ _configure()

None sdrforge.weather.vosk_native.VoskNativeAdapter._configure ( ctypes.CDLL lib)
staticprotected

◆ close()

None sdrforge.weather.vosk_native.VoskNativeAdapter.close ( self)

Provide close behavior.

Parameters
selfThe current instance.

◆ transcribe()

str sdrforge.weather.vosk_native.VoskNativeAdapter.transcribe ( self,
np.ndarray pcm,
int sample_rate )

Provide transcribe behavior.

Parameters
selfThe current instance.
pcmThe pcm value.
sample_rateThe sample rate value.
Returns
The operation result.

Member Data Documentation

◆ _lib

sdrforge.weather.vosk_native.VoskNativeAdapter._lib = lib
protected

◆ _model

sdrforge.weather.vosk_native.VoskNativeAdapter._model = model
protected

The documentation for this class was generated from the following file: