APIReference

JSVoice Class

Complete reference for the main JSVoice instance and its methods.

Constructor

typescript
1new JSVoice(options?: JSVoiceOptions)

Core Methods

start(): Promise<boolean>

Initialize the recognition engine and ask for permission.

stop(): void

Stop all listening processes.

speak(text: string, lang?: string): void

Synthesize speech output.

Command Registration

addCommand(phrase: string, cb: Function): void
addPatternCommand(pattern: string, cb: Function): void