Cheetah Flutter는 Picovoice의 Cheetah 음성 텍스트 엔진을 통합한 Flutter 플러그인으로, 낮은 지연 시간과 높은 정확도를 갖춘 실시간 온디바이스 음성 인식을 가능하게 합니다. 개인정보 보호에 중점을 둔 애플리케이션을 위해 설계되어 데이터를 클라우드로 전송하지 않고 오디오를 로컬에서 처리합니다. 이 플러그인은 Android 및 iOS 플랫폼을 지원하며, 오프라인 기능이 필요한 음성 제어 앱에 이상적입니다. 음성 인식 시작 및 중지, 변환된 텍스트 처리, 오디오 입력 관리를 위한 간단한 API를 제공합니다.
AccessKey is your authentication and authorization token for deploying Picovoice SDKs, including Cheetah. Anyone who is
using Picovoice needs to have a valid AccessKey. You must keep your AccessKey secret. You would need internet
connectivity to validate your AccessKey with Picovoice license servers even though the voice recognition is running 100%
offline.
AccessKey also verifies that your usage is within the limits of your account. You can see your usage limits and real-time usage on your Picovoice Console Profile. To get, renew or adjust your usage limits, please reach out to our Enterprise Sales Team or your existing Picovoice contact.
Language Support
Cheetah Streaming Speech-to-Text currently supports English, French, German, Italian, Portuguese, and Spanish.
./demo/c/build/cheetah_demo_mic -a ${ACCESS_KEY} -m ${MODEL_PATH} -l ${LIBRARY_PATH}
Replace ${ACCESS_KEY} with yours obtained from Picovoice Console, ${LIBRARY_PATH} with the path to appropriate
library under lib, and ${MODEL_PATH} to path to default model file
(or your custom one).
Replace let accessKey = "${YOUR_ACCESS_KEY_HERE}" in the file ViewModel.swift with your AccessKey.
Then, using Xcode, open the generated CheetahDemo.xcworkspace and run the application.
Android Demo
Using Android Studio, open demo/android/CheetahDemo as an Android project and then run the application.
Replace "${YOUR_ACCESS_KEY_HERE}" in the file MainActivity.java with your AccessKey.
Flutter Demo
To run the Cheetah demo on Android or iOS with Flutter, you must have the Flutter SDK installed on your system. Once installed, you can run flutter doctor to determine any other missing requirements for your relevant platform. Once your environment has been set up, launch a simulator or connect an Android/iOS device.
Run the prepare_demo script from demo/flutter with a language code to set up the demo in the language of your choice (e.g. de -> German, ko -> Korean). To see a list of available languages, run prepare_demo without a language code.
dart scripts/prepare_demo.dart ${LANGUAGE}
Replace "${YOUR_ACCESS_KEY_HERE}" in the file main.dart with your AccessKey.
Run the following command from demo/flutter to build and deploy the demo to your device:
flutter run
React Native Demo
To run the React Native Cheetah demo app you will first need to set up your React Native environment. For this,
please refer to React Native's documentation. Once your environment has
been set up, navigate to demo/react-native/CheetahDemo to run the following commands:
For Android:
yarn android-install # sets up environment
yarn android-run ${LANGUAGE}# builds and deploys to Android
For iOS:
yarn ios-install # sets up environment
yarn ios-run ${LANGUAGE}# builds and deploys to iOS
Node.js Demo
Install the demo package:
yarn global add @picovoice/cheetah-node-demo
With a working microphone connected to your device, run the following in the terminal:
cheetah-mic-demo --access_key ${ACCESS_KEY}
For more information about Node.js demos go to demo/nodejs.
Java Demos
The Cheetah Java demo is a command-line application that lets you choose between running Cheetah on an audio file or on real-time microphone input.
To try the real-time demo, make sure there is a working microphone connected to your device. Then invoke the following commands from the terminal:
cd demo/java
./gradlew build
cd build/libs
java -jar cheetah-mic-demo.jar -a ${ACCESS_KEY}
For more information about Java demos go to demo/java.
.NET Demo
Cheetah .NET demo is a command-line application that lets you choose between running Cheetah on an audio
file or on real-time microphone input.
Make sure there is a working microphone connected to your device. From demo/dotnet/CheetahDemo
run the following in the terminal:
dotnet run -c MicDemo.Release -- --access_key ${ACCESS_KEY}
Replace ${ACCESS_KEY} with your Picovoice AccessKey.
For more information about .NET demos, go to demo/dotnet.
Replace ${ACCESS_KEY} with yours obtained from Picovoice Console and ${MODEL_PATH} to path to
default model file (or your custom one). Finally, when done be sure to release
resources acquired using pv_cheetah_delete(handle).
iOS
The Cheetah iOS binding is available via CocoaPods. To import it into your iOS project, add the following line to your Podfile and run pod install:
pod 'Cheetah-iOS'
Create an instance of the engine and transcribe audio in real-time:
import Cheetah
let modelPath = Bundle(for: type(of: self)).path(
forResource: "${MODEL_FILE}", // Name of the model file name for Cheetah
ofType: "pv")!
let cheetah = Cheetah(accessKey: "${ACCESS_KEY}", modelPath: modelPath)
func getNextAudioFrame() -> [Int16] {
// .. get audioFrame
return audioFrame;
}
while true {
do {
let partialTranscript, isEndpoint = try cheetah.process(getNetAudioFrame())
if isEndpoint {
let finalTranscript = try cheetah.flush()
}
} catch let error as CheetahError {
// handle error
} catch { }
}
Replace ${ACCESS_KEY} with yours obtained from Picovoice Console and ${MODEL_FILE} with a custom trained model from
Picovoice Console or the default model.
Android
To include the package in your Android project, ensure you have included mavenCentral() in your top-level build.gradle file and then add the following to your app's build.gradle:
Replace ${ACCESS_KEY} with yours obtained from Picovoice Console and ${MODEL_FILE} with the default or custom trained model from console. When done be sure to explicitly release the resources using cheetah.delete().
When initialized, the valid sample rate is given by handle.SampleRate. Expected frame length (number of audio samples in an input array) is handle.FrameLength. The engine accepts 16-bit linearly-encoded PCM and operates on single-channel audio.