Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeWeb
SummaryPicovoice CheetahAzure Real-Time Speech-to-TextAmazon Transcribe StreamingGoogle Streaming ASR
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice PorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeSafariWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidArduinoC.NETiOSLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSMicrocontrollerNode.jsPythonWeb
SummaryPicovoice CobraWebRTC VADSilero VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Zebra Translate
Android API

API Reference for the Zebra Android SDK (zebra-android)

package: ai.picovoice.zebra


Zebra

public class Zebra { }

Class for the Zebra Translate engine.

Zebra must be initialized using the Builder() Class. Resources should be cleaned when you are done using the delete() function.


Zebra.getAvailableDevices()

public static String[] getAvailableDevices() throws ZebraException

Lists all available devices that Zebra can use for inference. Each entry in the list can be used as the device argument when initializing Zebra.

Returns

  • String[]: Array of all available devices that Zebra can be used for inference.

Throws

  • ZebraException: If an error occurs while getting available devices.

Zebra.delete()

public void delete()

Releases resources acquired by Zebra.


Zebra.getMaxCharacterLimit()

public int getMaxCharacterLimit()

Getter for the maximum number of characters that can be translated at once.

Returns

  • int: Maximum number of characters that can be translated at once.

Zebra.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Zebra version.

Zebra.translate()

public String translate(String text) throws ZebraException

Translates text. The maximum number of characters that can be translated at once is given by .getMaxCharacterLimit.

Parameters

  • text String : Text to translate.

Returns

  • String: Translated text.

Throws

  • ZebraException: If there is an error while translating.

Zebra.Builder

public static class Builder { }

Builder for creating an instance of Zebra.


Zebra.Builder.build()

public Zebra build(Context context) throws ZebraException

Creates an instance of Zebra Translate engine.

Parameters

  • context Context : The Android app context.

Returns

  • Zebra: An instance of Zebra Translate engine.

Throws

  • ZebraException: If an error occurs while creating an instance of Zebra Translate engine.

Zebra.Builder.setAccessKey()

public Zebra.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • Zebra.Builder: Modified Zebra.Builder object.

Zebra.Builder.setModelPath()

public Zebra.Builder setModelPath(String modelPath)

Sets the model path of the builder.

Parameters

  • 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. Sets the source and target translation languages.

Returns

  • Zebra.Builder: Modified Zebra.Builder object.

Zebra.Builder.setDevice()

public Zebra.Builder setDevice(String device)

Sets the device of the builder. If not set it will be set to the default device.

Parameters

  • device String : String representation of the device (e.g., CPU or GPU) to use. If set to best, the most suitable device is selected automatically. If set to gpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument to gpu:${GPU_INDEX}, where ${GPU_INDEX} is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument to cpu:${NUM_THREADS}, where ${NUM_THREADS} is the desired number of threads.

Returns

  • Zebra.Builder: Modified Zebra.Builder object.

ZebraException

public class ZebraException extends Exception { }

Exception thrown if an error occurs within Zebra Translate engine.

Exceptions:

public class ZebraActivationException extends ZebraException { }
public class ZebraActivationLimitException extends ZebraException { }
public class ZebraActivationRefusedException extends ZebraException { }
public class ZebraActivationThrottledException extends ZebraException { }
public class ZebraIOException extends ZebraException { }
public class ZebraInvalidArgumentException extends ZebraException { }
public class ZebraInvalidStateException extends ZebraException { }
public class ZebraKeyException extends ZebraException { }
public class ZebraMemoryException extends ZebraException { }
public class ZebraRuntimeException extends ZebraException { }
public class ZebraStopIterationException extends ZebraException { }

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Zebra Translate Android API
  • Zebra
  • getAvailableDevices()
  • delete()
  • getMaxCharacterLimit()
  • getVersion()
  • translate()
  • Zebra.Builder
  • build()
  • setAccessKey()
  • setModelPath()
  • setDevice()
  • ZebraException
Voice AI
  • picoLLM On-Device LLM
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.