Changes to WebOutLoud in iOS 17
It's that time of year again where the new iOS release is just a couple weeks away. This year it's iOS 17. The biggest feature that I can think of is "interactive widgets". Basically people can put buttons in their widgets now & they can share active state with the main app.
I spent a significant amount of time this week working on a widget for WebOutLoud, which I was hoping could take advantage of the new interactivity. I was pleased to find the new AudioPlaybackIntent
which looked promising. I thought this would allow me to create a widget with a play/pause button which could start and stop text to speech. However it doesn't seem to agree with how WebOutLoud does audio. It worked some of the time but not always. This obviously isn't acceptable.
I'm left to speculate why it doesn't work with my app. I'm assuming it has something to do with the asynchronous nature of the text to speech system. Pressing the play button does not simply start playback immediately. Sometimes there is a network request required, and some other asynchronous bits that take place under the hood. I can only assume this doesn't fit the narrow use case that Apple has accounted for.
So, ultimately what I had to do was compromise. I will be shipping a new widget for iOS 17 but when you press the "listen" button, it will simply open the app and then start playing, which works flawlessly every time. I think this may have been possible before interactive widgets, so it's a little underwhelming, I know.
In addition to the widget, WebOutLoud will be supporting iOS 17's new "Personal Voice". It's a feature where you can clone your voice and use it for text to speech not only with the new "Live Speech" feature but in apps as well. Your app simply needs to request permission to use the voice, and when granted it will show up among the other voices that are already available on the system. I tried it out with my own voice. The quality of the text to speech is ok, and it does sound like you. However, when I tried it in WebOutLoud, I noticed a couple of issues, first of all, it would simply skip some paragraphs of text for reasons unknown, and secondly, it appears to have a memory leak. I saw increasing memory consumption in my app the longer I listened with it. Anyway, I've put the new feature under a new "Experimental" section under the main menu.
Lastly, WebOutLoud will now refresh the list of free voices automatically whenever you add or remove voices from device settings. This wasn't possible prior to iOS 17 and users had to restart the app in order to see changes.