JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
339 stars 337 forks source link

WIP: workaround iOS16 speak readings #369

Closed stami closed 2 years ago

stami commented 2 years ago

Just a quick and very dirty workaround for iOS 16 beta not emitting any sound with AVSpeechSynthesizer. I filed a feedback about it already.

NOTE: this is a "works for me" workaround and should not be considered to be merged

I am sharing this so that others can cherry-pick this if they feel developer-y enough to run iOS betas. 😁

stami commented 2 years ago

https://developer.apple.com/forums/thread/712809

Okay it seems that one should be able to use AVSpeechSynthesizer on iOS 16 by retaining the instance. I tested it working with a separate test app but I'm hitting a wall with xdrip.

If I move the let syn = AVSpeechSynthesizer.init() in BGReadingSpeaker.swift to file level or to the class level (out of the say function) I get Heap buffer overflow from the framework :D

Can anyone try that? I'd like to know if my phone is in a funny state or if that's related to the xdripswift project.

Screenshot 2022-08-28 at 11 43 26
stami commented 2 years ago

The proposed fix in another PR: https://github.com/JohanDegraeve/xdripswift/pull/384