Orientação gerada a partir de informações públicas. Apenas para referência.
Cheetah Flutter é um plugin do Flutter que integra o motor de reconhecimento de fala Cheetah da Picovoice, permitindo reconhecimento de fala em tempo real, local no dispositivo, com baixa latência e alta precisão. Projetado para aplicações focadas na privacidade, ele processa áudio localmente sem enviar dados para a nuvem. O plugin suporta plataformas Android e iOS, tornando-o ideal para aplicativos controlados por voz que exigem funcionalidade offline. Ele fornece uma API simples para iniciar e parar o reconhecimento de fala, lidar com o texto transcrito e gerenciar a entrada de áudio.
Casos de uso
assistente de voz off-line
Dispositivos IoT controlados por voz
Aplicativos de transcrição sensíveis à privacidade
Reconhecimento de comando em tempo real
Processamento de fala no dispositivo
Principais recursos
Reconhecimento de fala no dispositivo
Desempenho de baixa latência
Suporta Android e iOS
Sem dependência de nuvem
Integração simples com o Flutter
Indicado para
Desenvolvedores construindo recursos de voz offline
Aplicativos que exigem privacidade de dados
Sistemas de comando de voz em tempo real
Dispositivos embutidos com voz habilitada
Projetos Flutter que precisam de ASR leve
Considerações
Requer configuração de plataforma nativa
Limitado a idiomas suportados
Pode ser necessário ajuste fino em ambientes barulhentos
Não adequado para tarefas de grande vocabulário
Depende da licença do motor Cheetah
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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.