Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
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 NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

Falcon Speaker Diarization
Android API

API Reference for the Android Falcon SDK (falcon-android)

package: ai.picovoice.falcon


Falcon

public class Falcon { }

Class for the Falcon Speaker Diarization engine.

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


Falcon.delete()

public void delete()

Releases resources acquired by Falcon.


Falcon.getSampleRate()

public int getSampleRate()

Getter for required audio sample rate for PCM data.

Returns

  • int: Required audio sample rate for PCM data.

Falcon.getVersion()

public String getVersion()

Getter for version.

Returns

  • String: Current Falcon version.

Falcon.process()

public FalconSegment[] process(short[] pcm) throws FalconException

Processes given audio data and returns speaker segments. The incoming audio needs to have a sample rate equal to .getSampleRate() and be 16-bit linearly-encoded. Furthermore, Falcon operates on single channel audio. If you wish to process data in a different sample rate or format consider using .processFile().

Parameters

  • pcm short[] : A frame of audio samples.

Returns

  • FalconSegment[]: Diarization output as an array of segments and their associated metadata.

Throws

  • FalconException: If there is an error while processing the audio frame.

Falcon.processFile()

public FalconSegment[] processFile(String path) throws FalconException

Processes a given audio file and returns speaker segments.

Parameters

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

Returns

  • FalconSegment[]: Diarization output as an array of segments and their associated metadata.

Throws

  • FalconException: If there is an error while processing the audio file.

Falcon.Builder

public static class Builder { }

Builder for creating an instance of Falcon.


Falcon.Builder.build()

public Falcon build(Context context) throws FalconException

Creates an instance of Falcon Speaker Diarization engine.

Parameters

  • context Context : The Android app context.

Returns

  • Falcon: An instance of Falcon Speaker Diarization engine.

Throws

  • FalconException: If an error occurs while creating an instance of Falcon Speaker Diarization engine.

Falcon.Builder.setAccessKey()

public Falcon.Builder setAccessKey(String accessKey)

Sets the AccessKey of the builder.

Parameters

  • accessKey String : AccessKey obtained from Picovoice Console.

Returns

  • Falcon.Builder: Modified Falcon.Builder object.

Falcon.Builder.setModelPath()

public Falcon.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.

Returns

  • Falcon.Builder: Modified Falcon.Builder object.

FalconException

public class FalconException extends Exception { }

Exception thrown if an error occurs within Falcon Speaker Diarization engine.

Exceptions:

public class FalconActivationException extends FalconException { }
public class FalconActivationLimitException extends FalconException { }
public class FalconActivationRefusedException extends FalconException { }
public class FalconActivationThrottledException extends FalconException { }
public class FalconIOException extends FalconException { }
public class FalconInvalidArgumentException extends FalconException { }
public class FalconInvalidStateException extends FalconException { }
public class FalconKeyException extends FalconException { }
public class FalconMemoryException extends FalconException { }
public class FalconRuntimeException extends FalconException { }
public class FalconStopIterationException extends FalconException { }

FalconSegment

public class FalconSegment {
public FalconSegment(float startSec, float endSec, int speakerTag) { }
}

Class that contains segment metadata from the diarization result returned from Falcon.process() and Falcon.processFile().

Parameters

  • startSec float : Start of segment in seconds.
  • endSec float : End of segment in seconds.
  • speakerTag int : A non-negative integer identifying unique speakers.

FalconSegment.getStartSec()

public float getStartSec()

Getter for the start of segment in seconds.

Returns

  • float: Start of segment in seconds.

FalconSegment.getEndSec()

public float getEndSec()

Getter for the end of segment in seconds.

Returns

  • float: End of segment in seconds.

FalconSegment.getSpeakerTag()

public int getSpeakerTag()

Getter for the speaker tag.

Returns

  • int: Speaker tag associated with speaker.

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Falcon Speaker Diarization Android API
  • Falcon
  • delete()
  • getSampleRate()
  • getVersion()
  • process()
  • processFile()
  • Falcon.Builder
  • build()
  • setAccessKey()
  • setModelPath()
  • FalconException
  • FalconSegment
  • getStartSec()
  • getEndSec()
  • getSpeakerTag()
Voice AI
  • 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
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
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.