Leopard Speech-to-Text
React Native Quick Start
Platforms
- Android (5.0+, API 21+)
- iOS (11.0+)
Requirements
- Picovoice Account and AccessKey
- React Native 0.62.2+
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your AccessKey
.
Make sure to keep your AccessKey
secret.
Quick Start
Setup
Setup the React Native environment .
Install the npm packages:
- Enable the proper permissions for recording with the hardware's microphone on both iOS and Android:
iOS
Open your Info.plist
and add the following line:
Android
Open your AndroidManifest.xml
and add the following line:
Adding Leopard Models
Create a custom model using the Picovoice Console or use a default language model .
Android
To add a Leopard model file to your Android application, add the file as a bundled resource by placing it under the assets
directory of your Android application.
iOS
To add a Leopard model file to your iOS application, add the file as a bundled resource by selecting Build Phases in Xcode
and adding it to the Copy Bundle Resources
step.
Usage
Create an instance of Leopard
using a custom model from Picovoice console or using a default model .
Transcribe an audio file by providing an absolute path to the file:
Transcribe raw audio data (sample rate of 16 kHz, 16-bit linearly encoded and 1 channel):
Free resources used by Leopard
:
Demo
For the Leopard React Native SDK, there is a React Native demo project available on the Picovoice GitHub repository .
Setup
Clone the Picovoice repository from GitHub:
Usage
- Install dependencies and setup environment:
- Connect a mobile device or launch a simulator. Then run the android-run or ios-run and replace
${LANGUAGE}
with the language code of your choice (e.g.de
-> German,ko
-> Korean). To see a list of available languages, command without a language code.
For more information on our Leopard demos for React Native, head over to our GitHub repository .