xdripswift icon indicating copy to clipboard operation
xdripswift copied to clipboard

Workaround for iOS16 speak readings bug

Open stami opened this issue 2 years ago • 1 comments

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 the value is between 0...15 (usual range with mmol/l units) it is read as is:
    • "Your current blood glucose is eleven point four"
  • When the value is over 15 (usually with mg/dl units), it is read digit by digit:
    • "Your current blood glucose is one three seven"
  • When the value is invalid it reads:
    • "Invalid reading. Please check the app."

When turned on

  • language gets reset to English and disabled
  • trend and delta gets disabled

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 avatar Oct 07 '22 18:10 stami

workaround for #388

stami avatar Oct 07 '22 18:10 stami

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.

stami avatar Nov 15 '22 19:11 stami

I did try that out but it didn't work

JohanDegraeve avatar Nov 15 '22 19:11 JohanDegraeve

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 avatar Nov 15 '22 19:11 stami

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…

stami avatar Jan 07 '23 13:01 stami

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

paulplant avatar Jan 07 '23 13:01 paulplant

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.

stami avatar Jan 14 '23 12:01 stami

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

paulplant avatar Feb 20 '23 11:02 paulplant

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

stami avatar Feb 20 '23 12:02 stami