I'm pretty sure I've read some stuff about pygame being mentioned on this forum, but I must know how menus and text is handled for the sake of screen readers. Is there an accessibility library that is commonly used? I know java has this sort of thing built in, but what does python have. I have seen one library,but it seemed to cover mac.
You probably want accessible_output2, if you want to develop programs that can explicitly communicate with screen readers and braille devices. . Pygame's ability to display text isn't inherently accessible, in the sense that java.awt.Graphics.drawString isn't inherently accessible.
3 (edited by magurp244 2017-09-15 21:58:13)
Generally libraries like pygame and pyglet are not screen reader accessible without external support libraries such as accessible_output2 as already mentioned, along with other libraries like Tolk or Pyttsx. Wxpython is considerably more accessible because it uses the operating systems native widgets, although that accessibility can be a bit patchy in places such as wx.Notebook being mostly accessible, but wx.AuiNotebook isn't.
I'd go for Tolk. It's far more stable.
Hmm, actually regarding tolk, it does work for python? I don't know a lot about the library, to be honest. Just that it is used for adding accessibility, and that I think Skullgirls uses it for it's accessibility. Does anyone have any good resources for setting it up? Actually, any resources for accessible_output2 would also be nice as well.
you can find the repository for accessible output at:
One thing you might want to keep in mind. IF you wish to have cross platform support for your game, only accessible_output2 is cross platform of the options mention. I've talked to the developer of tolk and to some up, he doesn't want to have to completely rewrite tolk to work with multiple platforms. Quentin C has a library for speech as well, but thats windows specific again and while he says he'd like people to try and port it to Mac and other os's, it would need a lot of work too.
just some thoughts. hope this helps.
Okay, I tried setting up Accessible_Output2, but it seems the dependencies it wants are not installing correctly. I have no idea, I know at least two of the setup.py files threw some sort of syntax error complaining about one of the print statements. Those were the platform_utils and Accessible_Output2 itself. Is Tolk less of a pain in the neck to get working on python?
Yes, it is. AO2 appears to be -- if your right -- python 2.x only, which is a shame. Tolk is Python 2/3.x compatible.
Can you provide the exact traceback?
accessible_output2 works just fine on py3
Great, does anyone know how to install Tolk for python? I've only seen one library that seems to be a networking thing.
if non-cross platform support doesn't matter in your situation:
Otherwise, I don't really know why your having difficulty with accessible_output2. Do you have pywin32?
Okay, I have a snippet from the installation messages.
code = compile(script, filename, 'exec')
tup.py", line 121
print "Building pywin32", pywin32_version
SyntaxError: Missing parentheses in call to 'print'
Also, yes, I did install pywin32. Though, I wonder if the Antivirus messed with it. I doubt it, though, after all, I made sure to have it off at the time I first ran this setup process.
Looks like your using the python 2 build script.
Run setup3 from:
Looks like the project was moved just a couple days ago from sourceforge. I wonder where the simple installers went?
Hmm, that seems wierd. I have a 3.6 32 bit installer which matches the python version I am running. It doesn't seem to be version mismatch on the part of pywin.
Ah, here are the installers I used. No problems here
https://sourceforge.net/projects/pywin3 … uild%20221
Wait, does the libloader dependency also make use of pywin32? That was the only one that seems to have installed successfully, though, it seems to be recognizing Accessible_output2, it complains more about platform utils more than anything.
My test code
import accessible_output2 as ao2
# List the screen readers that accessible_output2 can work with.
# Note that just because a screen reader is in this list, it does not mean that the user has it installed.
# Create an instance of a class using the SAPI output class.
# Note that it is item 6 on my system, but I'm not sure if it will be the same on yours.
sapi = ao2.get_output_classes()()
# List the methods and other attributes of the output class.
# The dir() function is a Python programmer's best friend.
# Speak the text "Hello, World!" using SAPI:
Now I'm wondering if it has something to do with the more obvious thing about that list might have changed, thus it is using the wrong index.
Traceback (most recent call last):
File "HelloWorld.py", line 1, in <module>
import accessible_output2 as ao2
sible_output2\__init__.py", line 5, in <module>
from platform_utils import paths
tils\paths.py", line 19, in <module>
ModuleNotFoundError: No module named 'winpaths'
Hmm, if it is pywin32 I wonder... I may have to try a new installation. If that occurs, will I need to try again with the rest of the libraries as well?
Okay, I've decided to give Tolk a go. The readme mentions a Tolk.pyo file, but I have no idea where to find the thing much less what to do with it once I have it. I'd like to try to avoid hand building all of this if possible. I doubt a simple pip install will help here as I think that's going to get me a networking library. Not useful.
You don't have to build any files, although you may have to shuffle around a few. You can download the current Tolk binaries from the AppVeyor link [here] which has everything you'll need, specifically tolk.py and its dependancies. In order to use it you'll also need tolk.dll and the individual screen reader dll's to support them for either x64 or x86 architecture, you can find them all in the "src/python/", "bin", and "lib" folders respectively. Once you have all the files in your working directory using it is easy, example:
import Tolk Tolk.load() print Tolk.detect_screen_reader() print Tolk.has_braille() print Tolk.has_speech() print Tolk.is_loaded() Tolk.silence() Tolk.output("Saying something!") Tolk.braille("Sending to braille display!") Tolk.unload()