Falcon Speaker Diarization
iOS API
API Reference for the iOS Falcon SDK (Cocoapod)
Falcon
Class for the Falcon Speaker Diarization engine.
Resources should be cleaned when you are done using the delete() function.
Falcon.getAvailableDevices()
Retrieves a list of devices that can be specified when constructing Falcon.
Returns
- [String] : An array of available devices.
Throws
FalconError: If an error occurs while retrieving the devices.
Falcon.init()
init method for Falcon Speaker Diarization engine.
Parameters
accessKeyString : The AccessKey obtained from Picovoice Console.modelPathString? : Absolute path to file containing model parameters (.pv).deviceString? : 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.
Throws
FalconError: If an error occurs while creating an instance of Falcon Speaker Diarization engine.
Falcon.delete()
Releases resources acquired by the Falcon engine.
Falcon.process()
Processes given audio data with the Falcon Speaker Diarization engine.
Parameters
pcm[Int16] : The incoming audio needs to have a sample rate equal toFalcon.sampleRateand be 16-bit linearly-encoded. Furthermore, Falcon operates on single-channel audio.
Returns
- [
FalconSegment] : Sequence of speaker segments with their associated metadata.
Throws
FalconError: If there is an error while processing the audio frame.
Falcon.processFile()
Processes a given audio file with the Falcon Speaker Diarization engine.
Parameters
audioPathString : Absolute path to the audio file. The supported formats are:3gp (AMR),FLAC,MP3,MP4/m4a (AAC),Ogg,WAVandWebM.
Returns
- [
FalconSegment] : Sequence of speaker segments with their associated metadata.
Throws
FalconError: If there is an error while processing the audio frame.
Falcon.processFile()
Processes a given audio file with the Falcon Speaker Diarization engine.
Parameters
audioURLURL : URL of the audio file. The supported formats are:3gp (AMR),FLAC,MP3,MP4/m4a (AAC),Ogg,WAVandWebM.
Returns
- [
FalconSegment] : Sequence of speaker segments with their associated metadata.
Throws
FalconError: If there is an error while processing the audio frame.
Falcon.sampleRate
Audio sample rate accepted by Falcon.
Falcon.version
Current Falcon version.
FalconError
Error thrown if an error occurs within Falcon Speaker Diarization engine.
FalconSegment
Struct for storing segment metadata returned from the Falcon engine.
FalconSegment.startSec
Start of segment in seconds.
FalconSegment.endSec
End of segment in seconds.
FalconSegment.speakerTag
Speaker tag is a non-negative integer identifying unique speakers.