UNPKG

@picovoice/cheetah-react-native

Version:

Picovoice Cheetah React Native binding

27 lines (26 loc) 1.57 kB
export type CheetahTranscript = { /** Any newly-transcribed speech. If none is available then an empty string is returned. */ transcript: string; /** Flag indicating if an endpoint has been detected. */ isEndpoint?: boolean; }; export type CheetahOptions = { /** String representation of the device (e.g., CPU or GPU) to use for inference. * If set to `best`, the most suitable device is selected automatically. If set to `gpu`, the engine uses the * first available GPU device. To select a specific GPU device, set this argument to `gpu:${GPU_INDEX}`, where * `${GPU_INDEX}` is the index of the target GPU. If set to `cpu`, the engine will run on the CPU with the * default number of threads. To specify the number of threads, set this argument to `cpu:${NUM_THREADS}`, * where `${NUM_THREADS}` is the desired number of threads. */ device?: string; /** Duration of endpoint in seconds. A speech endpoint is detected when there is a segment * of audio (with a duration specified herein) after an utterance without any speech in it. Set to `0` to disable * endpoint detection.*/ endpointDuration?: number; /** Set to `true` to enable automatic punctuation insertion. */ enableAutomaticPunctuation?: boolean; /** Set to `true` to enable text normalization. Enabling this feature * improves the readability and formatting of Cheetah's transcriptions (e.g. converts number words to digits) * at the cost of some additional latency. */ enableTextNormalization?: boolean; };