@picovoice/cheetah-react-native
Version:
Picovoice Cheetah React Native binding
37 lines (34 loc) • 2.03 kB
text/typescript
/*
Copyright 2022-2026 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
*/
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;
};