Leopard Speech-to-Text
Flutter Quick Start
Platforms
- Flutter (2.8.1+)
- Android (5.0+, API 21+)
- iOS (11.0+)
Requirements
- Flutter SDK
- Android SDK (21+)
- JDK (8+)
- Xcode (11+)
Picovoice Account & AccessKey
Signup or Login to Picovoice Console to get your AccessKey
.
Make sure to keep your AccessKey
secret.
Quick Start
Setup
Install Flutter SDK .
Run
flutter doctor
to determine any missing requirements.Add the Leopard plugin to your app project by referencing it in
pubspec.yaml
:
- 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:
Leopard Model File Integration
Add the Leopard model file to your Flutter application:
- Create a model in Picovoice Console or use a default language model .
- Add the model file to an
assets
folder in your project directory. - Add the asset to your
pubspec.yaml
:
- In this example, the path to the model file in code would then be as follows:
Usage
An instance of Leopard
is created by passing a model file path into its static constructor create
:
Transcribe an audio file by passing in the path:
When done, resources have to be released explicitly:
Demo
For the Leopard Flutter SDK, we offer demo applications that demonstrate how to use the Speech-to-Text engine on audio recordings.
Setup
Clone the Leopard repository from GitHub using HTTPS:
Usage
Replace
{YOUR_ACCESS_KEY_HERE}
with a validAccessKey
in the demo/flutter/lib/main.dart file:Copy assets:
NOTE: on Windows, Git Bash or another bash shell is required, or you will have to manually copy the Leopard demo model file
- Build and deploy the demo to your device:
For more information on our Leopard demos for Flutter, head over to our GitHub repository .
Resources
Package
API
GitHub
Benchmark