Wayback Machine
25 captures
28 Aug 2018 - 08 Aug 2024
May JUN Jul
12
2020 2021 2022
success
fail
About this capture
COLLECTED BY
Collection: GDELT Project
TIMESTAMPS
loading
The Wayback Machine - https://web.archive.org/web/20210612033009/https://developer.apple.com/videos/play/wwdc2018/236/

View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search Developer
Cancel
  • Apple Developer
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Limit search to

Quick Links

5 Quick Links

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos

Back to WWDC 2018

Streaming is available in most browsers,
and in the WWDC app.

  • Overview
  • Transcript
  • AVSpeechSynthesizer: Making iOS Talk

    Speech can enhance the audio experience of your app, whether you are generating spoken feedback for accessibility, or providing critical information beyond simple alerts or notifications. AVSpeechSynthesizer produces synthesized speech from text and allows you to control and monitor the progress of ongoing speech. Learn the ins and outs of AVSpeechSynthesizer and how to add computer-generated speech output to your app.

    Resources

      • HD Video
      • SD Video
    • Presentation Slides (PDF)

    Related Videos

    WWDC 2020

    • Create a seamless speech experience in your apps
  • Download

    Hello. My name is Chris Fleizach and let's talk about making iOS talk using AVSpeechSynthesis.

    So our agenda for today. What and why is AVSpeechSynthesis? Let's talk about some of the basics. We'll talk about choosing the right voice, some properties that are available like rate, pitch, and volume, and finally attributed strings.

    AVSpeechSynthesis is an API for generating computer synthesized speech on your iOS devices. It has many uses. For example, you might want to post announcements within your app. You might be creating an interface that's not meant to be looked at. Or you might be creating an education app where having synthesized speech provides a good reinforcement for learning materials.

    One example, providing audio updates during a workout can be communicated effectively using synthesized speech.

    A note about synthesis and accessibility. So speech synthesis is a powerful tool for helping many users with many disabilities. For example, cognitive users can get reinforcement about the output that they are experiencing. Users who have trouble vocalizing speech can use synthesis to generate speech for them. Non-sighted users use speech synthesis to consume their interfaces.

    However, it's important to note that it is not a replacement for VoiceOver or other screen reader technologies. For example, speech can overlap with what VoiceOver is speaking at the same time. And most of the speech won't be available to any devices that are connected such as a Braille device.

    Instead, you should make your app accessible using the UIAccessibility API. Okay. So let's get to the basics. First step, create an AVSpeechSynthesizer. You can use that with this code snippet. One thing to note is that you want to make sure that it's retained until speech is done. If the synthesizer goes out of scope, any synthesis in-flight will be canceled. Now that we've created a synthesis, the next job is to create an utterance. We can then dispatch that to the synthesizer.

    So, in this example, we create an utterance with the string hello and then we dispatch it using the speak method.

    A note about audio sessions. So when AVSpeechSynthesis is activated using speak, the audio session will automatically set to active. If you want to mix with other audio, you can use the setCategory with options on your shared AVAudioSession mixed with others. If you wanted to duck other audio so that your speech is primary but then other audio becomes lower in volume, you can