Reputation: 627
This is a questoin regarding new iOS 10 Speech framework. I get the speech recognition result using following method
recognitionTask = [speechRecgzr recognitionTaskWithRequest:recognitionRequest resultHandler:^(SFSpeechRecognitionResult * _Nullable result, NSError * _Nullable error) {
}
But the timestamp of each SFTranscriptionSegment in result is 0 and also confidence is always 0
What can be the problem here? Have apple not implemented the API properly yet?
Thank you.
Upvotes: 6
Views: 1222
Reputation: 30083
I encountered the same problem, and found that the timestamp
and duration
are always zero on partial results, but are set correctly on final results.
Check isFinal
on your SFSpeechRecognitionResult
instance. If that's true
, then the transcription segments will have this metadata.
If you only want to deal with final results, you can set shouldReportPartialResults
to false
on your SFSpeechRecognitionRequest
.
Upvotes: 1
Reputation: 627
After few weeks I found that by setting this I can get timestamp and confidence:
speechRecgzr.defaultTaskHint = SFSpeechRecognitionTaskHintDictation;
Upvotes: 1