Reference v0.1.2
voxxy/stt/platform
The browser's own speech recognition, with a note on whether audio leaves the device.
import { … } from "voxxy/stt/platform"
Functions
detectPlatformStt function
function detectPlatformStt(): { cloud: boolean; local: boolean }What this browser's own speech recognition can do. cloud: recognition exists, and the browser may send the audio to a service. local: it can also run on the device, with a language pack the browser installs. Safe to call anywhere; both are false where there is no recognition.
platformStt function
function platformStt(__namedParameters?: PlatformSttOptions): SttProviderSpeech recognition by the browser's own engine, as a push-to-talk SttProvider. Its locality says whether audio stays on the device, so show a notice when it is "cloud". With locality: "local" the language pack is an install the user agrees to through voxxy.models, like a model download.
Interfaces
PlatformSttOptions interface
interface PlatformSttOptionsOptions for platformStt(). All of them are optional.
lang?: stringLanguage to recognise, as a BCP 47 tag. Default "en-US".
locality?: "local" | "cloud""local" (default): recognise on the device with the browser's language pack, which the user must agree to install first. "cloud": the browser's ordinary recognition, which may send the audio to a service, with no download.
onAudioStart?: () => voidCalled when the browser starts capturing audio.
onEnd?: () => voidCalled once when a session settles, including on errors and cancellation.