Picovoice WordmarkPicovoice Console
Introduction
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSNodejsPythonRaspberry PiReact NativeRustWebWindows
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
AndroidC.NETFlutterlink to GoiOSJavaNodejsPythonReact NativeRustWeb
FAQ
Introduction
AndroidCiOSLinuxmacOSPythonWebWindows
AndroidCiOSPythonWeb
SummaryOctopus Speech-to-IndexGoogle Speech-to-TextMozilla DeepSpeech
FAQ
Introduction
AndroidAngularArduinoBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonLinuxmacOSMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaMicrocontrollerNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidAngularBeagleBoneCChrome.NETEdgeFirefoxFlutterlink to GoiOSJavaNvidia JetsonlinuxmacOSNodejsPythonRaspberry PiReactReact NativeRustSafariUnityVueWebWindows
AndroidAngularC.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidBeagleboneCiOSNvidia JetsonLinuxmacOSPythonRaspberry PiRustWebWindows
AndroidCiOSPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidAngularArduinoBeagleBoneC.NETFlutterlink to GoiOSJavaNvidia JetsonMicrocontrollerNodejsPythonRaspberry PiReactReact NativeRustUnityVueWeb
AndroidAngularCMicrocontroller.NETFlutterlink to GoiOSJavaNodejsPythonReactReact NativeRustUnityVueWeb
Picovoice SDK - FAQ
IntroductionSTM32F407G-DISC1 (Arm Cortex-M4)STM32F411E-DISCO (Arm Cortex-M4)STM32F769I-DISCO (Arm Cortex-M7)IMXRT1050-EVKB (Arm Cortex-M7)
FAQGlossary

Leopard Speech-to-Text
Flutter API


API Reference for the Flutter Leopard SDK (pub.dev)


Leopard

class Leopard { }

Class for the Leopard Speech-to-Text engine. Leopard must be initialized using create(). Resources should be cleaned when you are done using the delete() function.


Leopard.create()

Static creator for initializing Leopard.

static Future<Leopard> create(
String accessKey,
String modelPath,
{enableAutomaticPunctuation = false})

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.
  • modelPath String : Path to the file containing model parameters (.pv). Can be either a path that is relative to the project's assets folder or an absolute path to the file on device.
  • enableAutomaticPunctuation bool? : (Optional) Set to true to enable automatic punctuation insertion.

Returns

  • Future<Leopard> an instance of the speech-to-text engine.

Throws

  • LeopardException : If not initialized correctly.

Leopard.process()

Process a frame of pcm audio with the speech-to-text engine.

Future<LeopardTranscript> process(List<int>? frame)

Parameters

  • frame List<int> : a frame of audio samples to be assessed by Leopard. The required audio format is found by calling .sampleRate to get the required sample rate. Audio must be single-channel and 16-bit linearly-encoded.

Returns

  • Future<LeopardTranscript>: LeopardTranscript object which contains the transcription results of the engine.

Throws

  • LeopardException : If process fails.

Leopard.processFile()

Processes a given audio file with the speech-to-text-engine.

Future<LeopardTranscript> processFile(String path)

Parameters

  • path String : Absolute path to the audio file. The supported formats are: 3gp (AMR), FLAC, MP3, MP4/m4a (AAC), Ogg, WAV and WebM.

Returns

  • Future<LeopardTranscript>: LeopardTranscript object which contains the transcription results of the engine.

Throws

  • LeopardException : If process fails.

Leopard.delete()

Frees memory that was allocated for Leopard

Future<void> delete()

Leopard.sampleRate

int get sampleRate

Getter for the audio sample rate required by Leopard.


Leopard.version

String get version

Getter for Leopard version string.


LeopardException

class LeopardException implements Exception { }

Exception thrown if an error occurs within Leopard:

class LeopardMemoryException extends LeopardException { }
class LeopardIOException extends LeopardException { }
class LeopardInvalidArgumentException extends LeopardException { }
class LeopardStopIterationException extends LeopardException { }
class LeopardKeyException extends LeopardException { }
class LeopardInvalidStateException extends LeopardException { }
class LeopardRuntimeException extends LeopardException { }
class LeopardActivationException extends LeopardException { }
class LeopardActivationLimitException extends LeopardException { }
class LeopardActivationThrottledException extends LeopardException { }
class LeopardActivationRefusedException extends LeopardException { }

LeopardTranscript

class LeopardTranscript

Class that contains results from Leopard's process functions.


LeopardTranscript.transcript

String get transcript

Getter for transcript data.

Returns

  • String: Inferred transcript.

LeopardTranscript.words

List<LeopardWord> get words

Getter for word metadata in the form of LeopardWords.


LeopardWord

class LeopardWord

Class that contains word metadata.


LeopardWord.word

String get word

Getter for the transcribed word.


LeopardWord.startSec

final double startSec

Start time of word in seconds.


LeopardWord.endSec

final double endSec

End time of word in seconds.


LeopardWord.confidence

final double confidence

Transcription confidence. It is a number within [0, 1].

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Leopard Speech-to-Text Flutter API
  • Leopard
  • create()
  • process()
  • processFile()
  • delete()
  • sampleRate
  • version
  • LeopardException
  • LeopardTranscript
  • transcript
  • words
  • LeopardWord
  • word
  • startSec
  • endSec
  • confidence
Platform
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Octopus Speech-to-Index
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Demos
Sales
  • Pricing
  • Starter Tier
  • Enterprise
Company
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • Twitter
  • Medium
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2022 Picovoice Inc.