Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior when VoiceOver tries to read the text of games after starting or switching between them #80

Open
AERobert opened this issue Jul 28, 2024 · 7 comments

Comments

@AERobert
Copy link

When VoiceOver starts reading the game text, either by switching windows or starting up a game, it often gets confused and starts reading the wrong text. I have listed the most common behaviors I have noticed below

  • It will start reading the first line or so of text, and then start over.

  • If multiple game windows are open, it will sometimes decide to read from a different game, where it will start off with the correct first words on the current window, and interject with the first words on one of the other windows before starting over with the correct text.

  • the worst case is when it will start with the correct first line, and then try to read all the text from another game without reading any of the text from the correct window.

In the beta version, it seems like the first case happens most often and almost always when switching windows or when theres only one window. When theres multiple windows when starting a game, it seems almost random if it will do the second or the first case. Fortunately, so far, I haven't been able to identify a consistant trigger for the third case and it might have been stopped in the new version. When in the game window and just, say, moving between the status area and the main text, VO will read the text from the beginning normally.

It also seems like sometimes both case 1 and 2 can happen at the same time. For example, when I open Counterfeit Monkey with a game already open, it will repeat the opening text twice first, then after about a second, it will read the first words of the other window before repeating "Can you hear me?" again.

angstsmurf added a commit that referenced this issue Jul 29, 2024
The currentGame property of Preferences tracks the top game window
if more than one are open. Only the current games is allowed to
speak. Should at least help with #80
@angstsmurf
Copy link
Owner

I've added a check to make games keep quiet if they are not currently on top when there is more than one game active. Hopefully this will fix at least some of these things.

Implemented in test build 1.2.1 here:
https://github.com/angstsmurf/spatterlight/releases/tag/v1.2.1b

@AERobert
Copy link
Author

I haven't been getting the interruptions from other games with the newer build so far, so thats probably good. VO does still often repeat text when a game is open or focused, though this was of course the less annoying part of the problem.

@angstsmurf
Copy link
Owner

VO does still often repeat text when a game is open or focused

This is a bit of a rabbit hole.

To make a long story short, VoiceOver really wants to read all the text in a scroll view from the very top, which may be thousands of moves ago, and it may take hours for it to read it all. I try to prevent this by repeatedly forcing it to read the text of just the latest move instead. This is likely the cause of both the repeated text you hear and issue #84. Also, it only works some of the time: VoiceOver will often still start reading from the very top.

I'll see what I can do to improve things, but it is going to take some time.

@angstsmurf
Copy link
Owner

In the new test build, I've added some preferences to adjust the delay until we try to interrupt VoiceOver, or to completely turn off any attempts to interrupt it.

Note that we only do this when a game window in progress gets focus, either because a game autorestores at start, because we navigate away from a game window in Finder and then back to it, or because a dialog such as a save or restore panel temporarily takes over.

With the new delay slider, the end user gets the same dubious pleasure of experimenting with the unpredictable behaviour of VoiceOver as I had when working on this. It may help with this issue and with #84. My hope is that it at least won't make anything worse.

https://github.com/angstsmurf/spatterlight/releases/tag/v1.2.2b

@AERobert
Copy link
Author

AERobert commented Aug 5, 2024

In this version so far, VO has been much better behaved compared to previous versions, even when not messing with the controls you've added, though those also seem very useful. I haven't been getting the interruptions from other games at all now, and the controllable interruptions are not repeating the full text of the focused windows any more, which is far more pleasant. One note about the controls is that I can't really tell what adjusting the slider is doing at specific settings, for example switching to a window at 0% will speak the last move, but anything above that will speak out the full text seemingly without interruption.

Thank you for all the work you are doing to fix these issues in Spatterlight.

@angstsmurf
Copy link
Owner

angstsmurf commented Aug 10, 2024

It is great if setting the slider to 0 works for you, but unfortunately it seems very unreliable here. The main problem is that the behaviour is so random, and there doesn't seem to be proper solution that won't break half of the time. At least it is now possible to turn the interruptions off entirely.

I have plenty of ideas and hunches about what might make the interruptions more likely to work, but it is all guesswork. It seems reasonable to assume that the interruptions won't work if VoiceOver is for some reason delayed, so that our interruption speech comes before the speech it is supposed to interrupt. But that doesn't explain why the delay sometimes has to be more than five seconds in order to work.

The best advice is probably to use the "speak last move" shortcut (Option + Command + left arrow) whenever VoiceOver starts repeating all the text from the beginning.

Also, it would be nice of the unit of the slider was in seconds instead of a percentage. Currently the setting is a multiplier because I use different delays for different situations, but I honestly don't think it would make much of a difference if I changed them all to the same delay.

@angstsmurf
Copy link
Owner

New beta build where the delay settings are in seconds.
https://github.com/angstsmurf/spatterlight/releases/tag/v1.2.4b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants