Falcon Speaker Diarization
Web API
API Reference for the Falcon Web SDK (falcon-web).
Falcon
Class for the Falcon Speaker Diarization engine.
Falcon.create()
Creates an instance of Falcon Speaker Diarization engine using '.pv' file in public directory. The model size is large, hence it will try to use the existing one if it exists, otherwise saves the model in storage.
Parameters
accessKey
string : AccessKey obtained from Picovoice Console.model
FalconModel : Object containing Falcon model data.
Returns
Falcon
: An instance of the Falcon engine.
Falcon.process()
Processes audio. The required sample rate can be retrieved from '.sampleRate'. The audio needs to be 16-bit linearly-encoded. Furthermore, the engine operates on single-channel audio.
Parameters
pcm
Int16Array : Audio data.
Returns
FalconSegments
: The inferred segments.
Falcon.release()
Releases resources acquired by the Falcon Web SDK.
Falcon.sampleRate
Audio sample rate accepted by Falcon.
Falcon.version
Falcon version string.
FalconModel
Falcon model type.
FalconSegments
Falcon segments type.
segments
FalconSegment[] : Diarization output as an array of segments.
FalconSegment
Falcon segment type.
startSec
number : Position in seconds where the segment starts.endSec
number : Position in seconds where the segment ends.speakerTag
number : A non-negative integer that identifies unique speakers.
FalconWorker
A class for creating new instances of FalconWorker
.
FalconWorker.create()
Creates an instance of FalconWorker
using '.pv' file in public directory. The model size is large, hence it will try to use the existing one if it exists, otherwise saves the model in storage.
Parameters
accessKey
string : AccessKey obtained from Picovoice Console.model
FalconModel : Object containing Falcon model data.
Returns
FalconWorker
: An instance ofFalconWorker
.
FalconWorker.process()
Processes audio. The required sample rate can be retrieved from '.sampleRate'. The audio needs to be 16-bit linearly-encoded. Furthermore, the engine operates on single-channel audio.
Parameters
pcm
Int16Array : Audio data.options
Object : Optional process arguments.options.transfer
boolean : Optional flag to indicate if the buffer should be transferred or not. If set to true, input buffer array will be transferred to the worker.options.transferCallback
(pcm: Int16Array) => void : Optional callback containing a new Int16Array with contents frompcm
. Use this callback to get the input pcm when using transfer.
Returns
FalconSegments
: The inferred segments with metadata.
FalconWorker.release()
Releases resources acquired by the Falcon Web SDK.
FalconWorker.terminate()
Force terminates the instance of FalconWorker
.
FalconWorker.sampleRate
Audio sample rate accepted by Falcon.
FalconWorker.version
Falcon version string.