how to create a transcript of live speech
Generated on 8/2/2024
1 search
To create a transcript of live speech, you can use the speech recognition API as demonstrated in the session "Optimize for the spatial web" at WWDC 2024. Here’s a brief overview of the process:
-
Create a Speech Recognition Object: Start by creating a new speech recognition object. In Safari, this is prefixed with
Webkit
, but it follows a standard implementation. -
Register a Handler for Result Events: Register a handler to listen for result events. When you get the event back, it contains a result list of all the snippets the recognizer has picked up so far.
-
Extract the Transcript: From the result list, take the latest one. Inside that result, there are multiple speech recognition alternatives. Grab the first one, and inside each alternative is the transcript.
-
Start the Recognizer: Start the recognizer on a user event, like a tap or a click. Note that there will be a permission prompt for microphone input, so ensure the user understands why they are being asked for this permission.
For more detailed information, you can refer to the session Optimize for the spatial web.
Relevant Sessions
If you need more specific details or a different aspect of creating transcripts, feel free to ask!
Optimize for the spatial web
Discover how to make the most of visionOS capabilities on the web. Explore recent updates like improvements to selection highlighting, and the ability to present spatial photos and panorama images in fullscreen. Learn to take advantage of existing web standards for dictation and text-to-speech with WebSpeech, spatial soundscapes with WebAudio, and immersive experiences with WebXR.
Get started with Writing Tools
Learn how Writing Tools help users proofread, rewrite, and transform text in your app. Get the details on how Writing Tools interact with your app so users can refine what they have written in any text view. Understand how text is retrieved and processed, and how to support Writing Tools in custom text views.
Meet the Translation API
Discover how you can translate text across different languages in your app using the new Translation framework. We’ll show you how to quickly display translations in the system UI, and how to translate larger batches of text for your app’s UI.