BZSRData Class Reference
| Inherits from | NSObject |
| Declared in | BZSRData.swift |
Overview
An object of of BZSRData class is generated by Voiceflow processing whenever a speech recognition hypothesis is available. The callback method BZVFC_SRHypothesis(vfModuleID: String, srData: BZSRData) available in the callback protocol BZVoiceFlowCallback provides a BZSRData object in realtime to an application that is registered for callbacks.
A class initializing an instance of BZVoiceFlowController must be a subclass of BZVoiceFlowCallback and must implement BZVFC_SRHypothesis callbck method in order to receive BZSRData objects from BZVoiceFlow Framework.
Note: During BZVFC_SRHypothesis callback, an application has the option to reject the speech recognition hypothesis and to inform Voiceflow processing to treat the recognized hypothesis as such by setting the parameter srClientRejectedHypothesis to true.
Sample implementation code::
public final class MyVoiceFlowClass: NSObject, BZVoiceFlowCallback {
let bzVoiceFlowCallback = BZVoiceFlowController()
var bzResult = bzVoiceFlowController.initialize()
bzResult = bzVoiceFlowController.initializeDefaultAudioSession()
bzResult = bzVoiceFlowController.initializeDefaultMediaModules()
bzVoiceFlowController.setVoiceFlowCallback(self)
bzVoiceFlowController.loadAudioPromptModules(...)
bzVoiceFlowController.loadVoiceflow(...)
bzVoiceFlowController.runVoiceflow()
// Optional implementation of `BZVFC_SRHypothesis` callback method from BZVoiceFlowCallback protocol
func BZVFC_SRHypothesis(vfModuleID: String, srData: BZSRData) {
if srData.srHypothesis != nil && !srData.srHypothesis!.isEmpty {
// Application processes BZSRData object and may decide that it needs to be rejected or treated as garbage
if reject {
srData.srClientRejectedHypothesis = true
} else {
}
}
}
}
Tasks
-
srEnginepropertyThe speech recognition engine providing the speech recognition hypothesis.
-
srHypothesispropertyThe speech recognition hypothesis.
-
srHypothesisTypepropertyThe type of speech recognition hypothesis, whether partial or complete. Value is
BZNotifyMediaEvent.NME_SR_HYPOTHESIS_PARTIALorBZNotifyMediaEvent.NME_SR_HYPOTHESIS -
srResultStatuspropertyThe textual representation of the speech recognition result status code. Values: “<success>”, “<garbage>”, “<silence>”, “<stopped>”, “<canceled>”, and “<error>”.
-
srResultStatusCodepropertyThe speech recognition result status code.
-
srNumberOfSegmentspropertyThe number of segments availble in the speech recognition hypothesis. To obtain all the segments and the associated data, the client must be a subclass of
BZEventsObserverDelegatein order to receive the SR hypothesis event directly from theBZMediaframework. -
srProbScorepropertyThe speech recognition probability score.
-
srSRScorepropertyThe speech recognition score.
-
srSRConfidencepropertyThe speech recognition confidence score.
-
srTaskIDpropertyThe ID of the speech recognition task producing the speech recognition hypothesis. This ID is provided by the client. Client will receive this ID with all event notifications and callbacks associated with speech recognition using this task.
-
srUtterancepropertyThe file path name of the speech recognition utterance that was used to perform speech recognition upon during offline speech recognition on recorded utterances.
-
srClientRejectedHypothesispropertyThis parameter is initially set to
false. DuringBZVFC_SRHypothesiscallback, an application has the option to set this parameter totrueso Voiceflow processing treats the speech recognition hypothesis as rejected orgarbage.
Properties
srClientRejectedHypothesis
public var srClientRejectedHypothesis: Bool?
Discussion
This parameter is initially set to false. During BZVFC_SRHypothesis callback, an application has the option to set this parameter to true so Voiceflow processing treats the speech recognition hypothesis as rejected or garbage.
Declared In
BZSRData.swift
srEngine
public var srEngine: BZSREngine
Discussion
The speech recognition engine providing the speech recognition hypothesis.
Declared In
BZSRData.swift
srHypothesis
public var srHypothesis: String?
Discussion
The speech recognition hypothesis.
Declared In
BZSRData.swift
srHypothesisType
public var srHypothesisType: BZNotifyMediaEvent?
Discussion
The type of speech recognition hypothesis, whether partial or complete. Value is BZNotifyMediaEvent.NME_SR_HYPOTHESIS_PARTIAL or BZNotifyMediaEvent.NME_SR_HYPOTHESIS
Declared In
BZSRData.swift
srNumberOfSegments
public var srNumberOfSegments: Int?
Discussion
The number of segments availble in the speech recognition hypothesis. To obtain all the segments and the associated data, the client must be a subclass of BZEventsObserverDelegate in order to receive the SR hypothesis event directly from the BZMedia framework.
Declared In
BZSRData.swift
srProbScore
public var srProbScore: Int?
Discussion
The speech recognition probability score.
Declared In
BZSRData.swift
srResultStatus
public var srResultStatus: String?
Discussion
The textual representation of the speech recognition result status code. Values: “<success>”, “<garbage>”, “<silence>”, “<stopped>”, “<canceled>”, and “<error>”.
Declared In
BZSRData.swift
srResultStatusCode
public var srResultStatusCode: BZSRResultStatusCode?
Discussion
The speech recognition result status code.
Declared In
BZSRData.swift
srSRConfidence
public var srSRConfidence: Float?
Discussion
The speech recognition confidence score.
Declared In
BZSRData.swift
srSRScore
public var srSRScore: Int?
Discussion
The speech recognition score.
Declared In
BZSRData.swift
srTaskID
public var srTaskID: String?
Discussion
The ID of the speech recognition task producing the speech recognition hypothesis. This ID is provided by the client. Client will receive this ID with all event notifications and callbacks associated with speech recognition using this task.
Declared In
BZSRData.swift