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
accessKeystring : AccessKey obtained from Picovoice Console.modelFalconModel : 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
pcmInt16Array : 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.
Falcon.listAvailableDevices()
Lists all available devices that Falcon can use for inference. Each entry in the list can be the used as the device argument for the .create() method.
Returns
- string[] : List of all available devices that Falcon can use for inference.
FalconModel
Falcon model type.
FalconSegments
Falcon segments type.
segmentsFalconSegment[] : Diarization output as an array of segments.
FalconSegment
Falcon segment type.
startSecnumber : Position in seconds where the segment starts.endSecnumber : Position in seconds where the segment ends.speakerTagnumber : 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
accessKeystring : AccessKey obtained from Picovoice Console.modelFalconModel : Object containing Falcon model data.devicestring? : device String representation of the device (e.g., CPU or GPU) to use. If set tobest, the most suitable device is selected automatically. If set togpu, the engine uses the first available GPU device. To select a specific GPU device, set this argument togpu:${GPU_INDEX}, where${GPU_INDEX}is the index of the target GPU. If set tocpu, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this argument tocpu:${NUM_THREADS}, where${NUM_THREADS}is the desired number of threads.
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
pcmInt16Array : Audio data.optionsObject : Optional process arguments.options.transferboolean : 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.