JohanDegraeve / xdripswift

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

Workaround for iOS16 speak readings bug #392

Closed stami closed 1 year ago

stami commented 1 year ago

This PR is split to three commits.

First changes the SoundPlayer to accept multiple sound files to play at once. That is an enhancement which, although made for the workaround, can be useful even after the workaround is removed in the future.

Second commit is the actual workaround.

I generated files with https://ttsmp3.com/ and normalized their volume with Audacity, as they were a bit quiet out-of-the-box.

The logic in BGReadingSpeaker.swift is quite extensively commented but in short it does the following:

When turned on

I don't know how to explain to users what that setting actually does, and why it doesn't work like the actual feature... 🤷 Expect confusion. 😬

workaround off workaround ON
workaround_off workaround_on

Third commit fixes a cell reusing bug that appeared with disabled rows 😄

stami commented 1 year ago

workaround for #388

stami commented 1 year ago

Hi @JohanDegraeve if you happen to have time to review this, it would help a lot of people until we have a proper fix 😊

Happy to make any adjustments if needed.

JohanDegraeve commented 1 year ago

I did try that out but it didn't work

stami commented 1 year ago

I think you are talking about https://github.com/JohanDegraeve/xdripswift/pull/384 🤔 if not, please tell more.

I ended up implementing the ”pre-generated mp3” solution to a more completed feature, and this PR is about it.

stami commented 1 year ago

Hi, any chance getting a review for this? There are people asking for the feature in Facebook and this could fix the issue for many of them.

I’ve been running this without issues and will continue doing so, so I am fine with this not being merged, but I do feel a little bad for people wishing for speak readings to work even somehow…

paulplant commented 1 year ago

Sure - let us get the new Libre 2 NFC re-write and other changes released and then we'll look closely at this one!

stami commented 1 year ago

Thanks! Now that I’ve been running this branch without any other local tweaks of mine, I have noticed that the speaking does not work as expected. It misses many of times it should announce the reading and only occasionally speaks. I’ll look into it.

paulplant commented 1 year ago

Hi @stami , we fixed the BG speak issue in 9380633 and it is now merged into master. We'll close this open issue/PR.

stami commented 1 year ago

Oh, cool if it isn't crashing anymore! That's good news 👍