SFTranscriptionSegment's timestamp is always 0
Asked Answered
C

3

6

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.

Chrestomathy answered 6/9, 2016 at 22:10 Comment(0)
C
1

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

speechRecgzr.defaultTaskHint = SFSpeechRecognitionTaskHintDictation;
Chrestomathy answered 15/9, 2016 at 15:39 Comment(1)
Hi, im having the exact same problem, bit this didn't fix my issue. Did you maybe change anything else?Hang
K
1

Swift 5+

speechRecgzr.defaultTaskHint = .dictation
Katharyn answered 2/7, 2020 at 4:26 Comment(0)
B
1

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.

Bellarmine answered 8/8, 2020 at 15:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.