New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@picovoice/cheetah-react-native

Package Overview
Dependencies
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@picovoice/cheetah-react-native

Picovoice Cheetah React Native binding

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
increased by153.33%
Maintainers
6
Weekly downloads
 
Created
Source

Cheetah Binding for iOS

Cheetah Speech-to-Text Engine

Made in Vancouver, Canada by Picovoice

Cheetah is an on-device speech-to-text engine. Cheetah is:

  • Private; All voice processing runs locally.
  • Accurate [1]
  • Compact and Computationally-Efficient [2]
  • Cross-Platform:
    • Linux (x86_64)
    • macOS (x86_64, arm64)
    • Windows (x86_64)
    • Android
    • iOS
    • Raspberry Pi (4, 3)
    • NVIDIA Jetson Nano

Compatibility

This binding is for running Cheetah on React Native 0.62.2+ on the following platforms:

  • Android 4.4+ (SDK 19+)
  • iOS 10.0+

Installation

To start install be sure you have installed yarn and CocoaPods. Then add these two native modules to your react-native project.

yarn add @picovoice/cheetah-react-native

or

npm i @picovoice/cheetah-react-native --save

Link the iOS package

cd ios && pod install && cd ..

NOTE: Due to a limitation in React Native CLI auto-linking, the native module cannot be included as a transitive dependency. If you are creating a module that depends on cheetah-react-native, you will have to list these as peer dependencies and require developers to install it alongside.

AccessKey

Cheetah requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Cheetah SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Adding custom Cheetah models

Android

Add the Cheetah model file to your Android application by:

  1. Either creating a model in Picovoice Console or get the default model in /lib/common/cheetah_params.pv.
  2. Add the model as a bundled resource by placing it under the assets directory of your Android application.

iOS

Open Cheetah.xcodeproj in Xcode and add the Cheetah model file in Xcode by:

  1. Either creating a model in Picovoice CAT Console or get the default model in /lib/common/cheetah_params.pv.
  2. Add the model as a bundled resource by selecting Build Phases and adding it to Copy Bundle Resources step.

Usage

Transcribe audio:

import {Cheetah, CheetahErrors} from '@picovoice/cheetah-react-native';

const getAudioFrame = () => {
  // get audio frames
}

try {
  while (1) {
    const cheetah = await Cheetah.create("${ACCESS_KEY}", "${MODEL_FILE}")
    const [partialTranscript, isEndpoint] = await cheetah.process(getAudioFrame())
    if (isEndpoint) {
      const finalTranscript = await cheetah.flush()
    }
  }
} catch (err: any) {
  if (err instanceof CheetahErrors) {
    // handle error
  }
}

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console and ${MODEL_FILE} with the name of the Cheetah model file name. Finally, when done be sure to explicitly release the resources using cheetah.delete().

Demo App

For example usage refer to our React Native demo application.

Keywords

FAQs

Package last updated on 13 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc