Falcon Speaker Diarization
Python API
API Reference for the Python Falcon SDK (PyPI).
pvfalcon.create()
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
pvfalcon.Falcon
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
The version string of the Falcon library.
pvfalcon.Falcon.sample_rate
The audio sample rate the Falcon accepts.
pvfalcon.Falcon.__init__()
__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
pvfalcon.Falcon.delete()
Releases resources acquired by Falcon.
pvfalcon.Falcon.process()
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
pvfalcon.Falcon.process_file()
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
pvfalcon.Falcon.Segment
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
Error thrown if an error occurs within Falcon
Speaker Diarization engine.
Exceptions