AudioClassifierStreamDelegate
protocol AudioClassifierStreamDelegate : NSObjectProtocolThis protocol defines an interface for the delegates of AudioClassifier object to receive results of asynchronous classification of audio stream (i.e, when runningMode = .audioStream).
The delegate of AudioClassifier must adopt AudioClassifierStreamDelegate protocol. The methods in this protocol are optional.
-
This method notifies a delegate that the results of asynchronous classification of an audio stream submitted to the
AudioClassifieris available.This method is called on a private serial queue created by the
AudioClassifierfor performing the asynchronous delegates calls.Declaration
Swift
optional func audioClassifier(_ AudioClassifier: AudioClassifier, didFinishClassification result: AudioClassifierResult?, timestampInMilliseconds: Int, error: (any Error)?)Parameters
AudioClassifierThe audio classifier which performed the classification. This is useful to test equality when there are multiple instances of
AudioClassifier.resultAn
AudioClassifierResultobject that contains a list of audio classifications.timestampInMillisecondsThe timestamp (in milliseconds) which indicates when the audio clip was sent to the audio classifier.
errorAn optional error parameter populated when there is an error in performing audio classification on the input audio stream data.