Skip to content

@graphty/graphty-element / ai / VoiceInputAdapter

Class: VoiceInputAdapter ​

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:85

Voice input adapter using the Web Speech API. Provides voice-to-text functionality with support for interim and final results.

Implements ​

Constructors ​

Constructor ​

new VoiceInputAdapter(): VoiceInputAdapter

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:99

Creates a new VoiceInputAdapter instance.

Returns ​

VoiceInputAdapter

Properties ​

type ​

readonly type: "voice"

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:86

Type of input this adapter handles

Implementation of ​

InputAdapter.type

Accessors ​

isActive ​

Get Signature ​

get isActive(): boolean

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:115

Get whether voice input is currently active.

Returns ​

boolean

True if listening for voice input

Whether this adapter is currently active (listening)

Implementation of ​

InputAdapter.isActive


isSupported ​

Get Signature ​

get isSupported(): boolean

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:107

Check if voice input is supported in this browser.

Returns ​

boolean

True if Web Speech API is available

Whether this adapter is supported in the current environment

Implementation of ​

InputAdapter.isSupported

Methods ​

dispose() ​

dispose(): void

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:230

Clean up resources and remove all callbacks.

Returns ​

void

Implementation of ​

InputAdapter.dispose


onActiveChange() ​

onActiveChange(callback): void

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:223

Register a callback for every voice session starting and ending. Unlike VoiceInputAdapter.onStart it stays registered across sessions.

Parameters ​

callback ​

VoiceActiveCallback

Called with (true) on start and (false, reason) on end

Returns ​

void


onInput() ​

onInput(callback): void

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:205

Register a callback for input events.

Parameters ​

callback ​

InputCallback

Function called when voice input is received

Returns ​

void

Implementation of ​

InputAdapter.onInput


onStart() ​

onStart(callback): void

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:214

Register a callback for start/error events. Called when recognition successfully starts or fails to start.

Parameters ​

callback ​

VoiceStartCallback

Function called with (started: boolean, error?: string)

Returns ​

void


start() ​

start(options?): void

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:123

Start listening for voice input.

Parameters ​

options? ​

InputOptions

Optional configuration for the voice input session

Returns ​

void

Implementation of ​

InputAdapter.start


stop() ​

stop(): void

Defined in: graphty-element/src/ai/input/VoiceInputAdapter.ts:183

Stop listening for voice input.

Returns ​

void

Implementation of ​

InputAdapter.stop