I remember reading somewhere in a different HN thread that some tools use pitch to represent indentation depth. There are all sorts of audio cues that can be used to represent syntactic information about code.
That's really interesting. I wonder what other audio cues can be used other than the simple content of the words.
Voice, maybe? Humans are great at distinguishing lots of different voices. Are there any screen reader tools that use a mixture of different people's voices to add additional fidelity to the information?
Yes, some screen readers such as JAWS can be configured to use a different voice to represent bold text, for example. They can also use non-speech sounds to represent things such as HTML elements.
One of the things that really blew my mind is just how fast a proficient screen reader user can crank up the speed, e.g. https://soundcloud.com/freecodecamp/zersiaxs-screen-reader. It's totally unintelligible to me, and doesn't even sound much like human speech.
If you're no longer constrained by the speed and sound of normal speech all kinds of other interesting audio representations become possible.
My understanding is that most people perceive relative pitch in music (is this note higher or lower than the other notes around it) but not absolute pitch. I'd expect people to have to no trouble teasing out the indentation of a stretch of code, but if you hear just a few words out of context (which you do a lot with a screen reader... I'm not blind but I've been tasked with making sites accessible and spent a lot of time w/ NVDA) you will probably lose the thread.
I'm not blind, but I would say that in any case you need your screen reader the ability to tell you
"the current line is inside that if , which is inside that function" when you hit a "give me the context" ? regardless of the indentation system of said language
It would be pretty trivial to write an AST visitor that would treat each new indentation level as an “inside [function|while|if|etc]” … that’s going to handle your already syntactically correct code. Bit harder to deal with syntax errors and mixed indentation, but if there’s a way to tell a sighted user about it there’s a way to tell a not-sighted one.
Assuming you care enough about humans to do so, mind.
I really hope they used tabs instead of spaces .... space space space space space if ah equals equals bee ... space space space space space space space space space ...
I'm going insane just thinking about counting spaces.