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 Quick Start

Platforms

  • Linux (x86_64)
  • macOS (x86_64, arm64)
  • Windows (x86_64, arm64)
  • Raspberry Pi (3, 4, 5)

Requirements

  • Picovoice Account & AccessKey
  • Python 3.9+
  • PIP

Picovoice Account & AccessKey

Signup or Login to Picovoice Console to get your AccessKey. Make sure to keep your AccessKey secret.

Quick Start

Setup

  1. Install Python 3.

  2. Install the pvfalcon Python package using PIP:

pip3 install pvfalcon

Usage

Create an instance of the engine and perform speaker diarization on an audio file:

import pvfalcon
falcon = pvfalcon.create(access_key="${ACCESS_KEY}")
segments = falcon.process_file("${AUDIO_PATH}")
for segment in segments:
print(
"{speaker_tag=%d start_sec=%.2f end_sec=%.2f}"
% (segment.speaker_tag, segment.start_sec, segment.end_sec)
)

Perform speaker diarization on raw audio data (sample rate of 16 kHz, 16-bit linearly encoded and 1 channel):

def get_audio_data():
# get audio data
segments = falcon.process(get_audio_data())
for segment in segments:
print(
"{speaker_tag=%d start_sec=%.2f end_sec=%.2f}"
% (segment.speaker_tag, segment.start_sec, segment.end_sec)
)

Free resources used by Falcon Speaker Diarization:

falcon.delete();

Segments

Falcon Speaker Diarization returns an array of segments. Each segment has the following properties:

  • Start Time: Indicates when the segment started. Value is in seconds.
  • End Time: Indicates when the segment ended. Value is in seconds.
  • Speaker Tag: A non-negative integer identifying unique speakers.

Demo

For the Falcon Speaker Diarization Python SDK, we offer a demo applications that demonstrates how to use the Speaker Diarization engine on audio files.

Setup

Install the pvfalcondemo Python package using PIP:

pip3 install pvfalcondemo

This package installs command-line utilities for the Falcon Speaker Diarization Python demos.

Usage

Use the --help flag to see the usage options for the demo:

falcon_demo_file --help

Run the following command to perform speaker diarization on an audio file:

falcon_demo_file --access_key ${ACCESS_KEY} \
--audio_paths ${AUDIO_PATH1} ${AUDIO_PATH2} ...

For more information on our Falcon Speaker Diarization demos for Python, head over to our GitHub repository.

Resources

Packages

  • pvfalcon on PyPI
  • pvfalcondemo on PyPI

API

  • pvfalcon Python API Docs

GitHub

  • Falcon Speaker Diarization Python SDK on GitHub
  • Falcon Speaker Diarization Python demo on GitHub

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Falcon Speaker Diarization Python Quick Start
  • Platforms
  • Requirements
  • Picovoice Account & AccessKey
  • Quick Start
  • Setup
  • Usage
  • Segments
  • Demo
  • Setup
  • Usage
  • Resources
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.