VadPlusBindings class

Bindings for src/vad_plus.h.

Regenerate bindings with dart run ffigen --config ffigen.yaml.

Constructors

VadPlusBindings(DynamicLibrary dynamicLibrary)
The symbols are looked up in dynamicLibrary.
VadPlusBindings.fromLookup(Pointer<T> lookup<T extends NativeType>(String symbolName))
The symbols are looked up with lookup.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
vad_config_default(Pointer<VADConfig> config_out) → void
Create default VAD configuration for Silero VAD @param config_out Pointer to VADConfig struct to fill with default values
vad_create() Pointer<VADHandle>
Create a new VAD instance @return Pointer to new VAD handle, or NULL on failure
vad_destroy(Pointer<VADHandle> handle) → void
Destroy a VAD instance and free resources @param handle VAD handle to destroy
vad_float_to_pcm16(Pointer<Float> float_samples, Pointer<Int16> pcm16_samples, int sample_count) → void
Convert float32 audio samples to PCM16 @param float_samples Input float32 samples (-1.0 to 1.0) @param pcm16_samples Output PCM16 buffer (must be allocated) @param sample_count Number of samples
vad_force_end_speech(Pointer<VADHandle> handle) → void
Force end current speech segment if any @param handle VAD handle
vad_get_last_error(Pointer<VADHandle> handle) Pointer<Char>
Get the last error message @param handle VAD handle @return Error message string (do not free)
vad_init(Pointer<VADHandle> handle, Pointer<VADConfig> config, Pointer<Char> model_path) int
Initialize VAD with configuration and model @param handle VAD handle @param config Pointer to VAD configuration @param model_path Path to ONNX model file (can be NULL for bundled model) @return 0 on success, negative error code on failure
vad_invalidate_callback(Pointer<VADHandle> handle) → void
Invalidate the callback to prevent it from being invoked This MUST be called before closing the Dart NativeCallable to prevent crashes. Uses synchronous dispatch to ensure all pending callbacks complete first. @param handle VAD handle
vad_is_speaking(Pointer<VADHandle> handle) int
Check if VAD is currently detecting speech @param handle VAD handle @return 1 if speech is being detected, 0 otherwise
vad_pcm16_to_float(Pointer<Int16> pcm16_samples, Pointer<Float> float_samples, int sample_count) → void
Convert PCM16 audio samples to float32 @param pcm16_samples Input PCM16 samples @param float_samples Output float32 buffer (must be allocated) @param sample_count Number of samples
vad_process_audio(Pointer<VADHandle> handle, Pointer<Float> samples, int sample_count) int
Process audio samples directly (without microphone capture) Use this when you have your own audio source @param handle VAD handle @param samples Pointer to float32 audio samples (normalized -1.0 to 1.0) @param sample_count Number of samples @return 0 on success, negative error code on failure
vad_reset(Pointer<VADHandle> handle) → void
Reset VAD state (clear buffers and speech detection state) @param handle VAD handle
vad_set_callback(Pointer<VADHandle> handle, VADEventCallback callback, Pointer<Void> user_data) → void
Set the event callback for VAD events @param handle VAD handle @param callback Event callback function @param user_data User data passed to callback
vad_start(Pointer<VADHandle> handle) int
Start audio capture and VAD processing @param handle VAD handle @return 0 on success, negative error code on failure
vad_stop(Pointer<VADHandle> handle) → void
Stop audio capture and VAD processing @param handle VAD handle

Operators

operator ==(Object other) bool
The equality operator.
inherited