SFTranscriptionSegment's timestamp is always 0

2019-05-05 17:31发布

问题:

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.

回答1:

After few weeks I found that by setting this I can get timestamp and confidence:

speechRecgzr.defaultTaskHint = SFSpeechRecognitionTaskHintDictation;