Is there a way to find a word in an audio and go to it?

Is there any way for iOS to translate speech to text and mark the spot of time in the audio file when a certain word appears?


For example, in an audio file of 1:00 minute length, the word "hello" might occur at the 30 second mark. I would like my code to be able to find the word "hello" and mark that spot of time in the audio s that my code could go to that place and play the audio at that mark.

Replies

The timing information is available from this class:


https://developer.apple.com/documentation/speech/sftranscriptionsegment


provided that the transcription's "isFinal" property is true. You can work your way down from the recognition result to the segments, find the segment you want, then use its timings to trim your audio.