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
Python API

API Reference for the Python Falcon SDK (PyPI).


pvfalcon.create()

def create(
access_key: str,
model_path: Optional[str] = None,
library_path: Optional[str] = None) -> Falcon

Factory method for Falcon Speaker Diarization engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path Optional[str] : Absolute path to the file containing model parameters (.pv).
  • library_path Optional[str] : Absolute path to Falcon's dynamic library.

Returns

  • Falcon : An instance of Falcon Speaker Diarization engine.

Throws

  • FalconError

pvfalcon.Falcon

class Falcon(object)

Class for the Falcon Speaker Diarization engine. Falcon can be initialized either using the module level create() function or directly using the class __init__() method. Resources should be cleaned when you are done using the delete() method.


pvfalcon.Falcon.version

self.version: str

The version string of the Falcon library.


pvfalcon.Falcon.sample_rate

self.sample_rate: int

The audio sample rate the Falcon accepts.


pvfalcon.Falcon.__init__()

def __init__(
self,
access_key: str,
model_path: str,
library_path: str) -> Falcon

__init__ method for Falcon Speaker Diarization engine.

Parameters

  • access_key str : AccessKey obtained from Picovoice Console.
  • model_path str : Absolute path to the file containing model parameters (.pv).
  • library_path str : Absolute path to Falcon's dynamic library.

Returns

  • Falcon: An instance of Falcon Speaker Diarization engine.

Throws

  • FalconError

pvfalcon.Falcon.delete()

def delete(self)

Releases resources acquired by Falcon.


pvfalcon.Falcon.process()

def process(self, pcm: Sequence[int]) -> Sequence[Segment]

Processes the given audio data and returns the diarization output. The audio needs to have a sample rate equal to .sample_rate and be 16-bit linearly-encoded. This function operates on single-channel audio. If you wish to process data in a different sample rate or format consider using .process_file().

Parameters

  • pcm Sequence[int] : Audio data.

Returns

  • Sequence[Segment] : Diarization output as a sequence of segments. Each segment is a tuple of (start_sec, end_sec, speaker_tag).

Throws

  • FalconError

pvfalcon.Falcon.process_file()

def process_file(self, audio_path: str) -> Sequence[Segment]

Processes a given audio file and returns the diarization output. The supported audio formats are: 3gp (AMR), FLAC, MP3, MP4/m4a (AAC), Ogg, WAV, and WebM.

Parameters

  • audio_path str : Absolute path to the audio file.

Returns

  • Sequence[Segment] : Diarization output as a sequence of segments. Each segment is a tuple of (start_sec, end_sec, speaker_tag).

Throws

  • FalconError

pvfalcon.Falcon.Segment

Segment = namedtuple('Segment', ['start_sec', 'end_sec', 'speaker_tag'])

Named tuple for representing a speaker diarization segment.

  • start_sec float : Start time of the segment in seconds.
  • end_sec float : End time of the segment in seconds.
  • speaker_tag int : Speaker tag identifier - a non-negative integer that uniquely identifies a speaker.

pvfalcon.FalconError

class FalconError(Exception)

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

Exceptions

class FalconActivationError(FalconError)
class FalconActivationLimitError(FalconError)
class FalconActivationRefusedError(FalconError)
class FalconActivationThrottledError(FalconError)
class FalconIOError(FalconError)
class FalconInvalidArgumentError(FalconError)
class FalconInvalidStateError(FalconError)
class FalconKeyError(FalconError)
class FalconMemoryError(FalconError)
class FalconRuntimeError(FalconError)
class FalconStopIterationError(FalconError)

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Falcon Speaker Diarization Python API
  • pvfalcon.create()
  • pvfalcon.Falcon
  • version
  • sample_rate
  • __init__()
  • delete()
  • process()
  • process_file()
  • Segment
  • pvfalcon.FalconError
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.