How to use speechtranscriber

Asked on 2025-06-11

1 search

To use the Speech Transcriber, you can follow these steps as outlined in the session "Bring advanced speech-to-text to your app with SpeechAnalyzer" from WWDC 2025:

  1. Configure the Speech Transcriber: Initialize the Speech Transcriber with a locale object and the necessary options. The locale's language code should correspond to the language you want to transcribe. You can also set options like audio time range to sync text playback with audio.

  2. Ensure the Model is Present: Check if the Speech Transcriber supports the language you want to transcribe. If the language is supported but not downloaded, you can request the model via the Asset Inventory API. The transcription is entirely on-device, but models need to be fetched.

  3. Handle the Results: The Speech Transcriber returns results via an async stream. You can track volatile and finalized results. Volatile results are real-time guesses, while finalized results are the best guesses. Use the async stream to process these results and update your application accordingly.

For more detailed guidance, you can refer to the session chapter on Build a speech-to-text feature (09:06) in the "Bring advanced speech-to-text to your app with SpeechAnalyzer" session.