Skip to main content

speech

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

What the screen reader says — VoiceOver on a real iPhone (iOS 27, a runner built by Xcode 27), TalkBack on Android. These call app_speech.

speech​

def speech(target: str | None=None, walk: bool=False, limit: int | None=None, listen: str | None=None) -> dict

What the screen reader says: VoiceOver on a real iPhone, TalkBack on Android. The screen reader must be on (accessibility("screen_reader", "on")).

Returns the screen_reader and steps, each the sentence said and the element it was said about — its label, role, locator and in_map — when that can be told. With target the cursor is put on that element first; with walk it moves forward through the screen until it goes no further, comes back round or makes limit moves, and ended says which. listen="start" before an action and listen="stop" after it answer with what the screen reader said in between, each step with its cause on Android.

Examples​

Say what the screen reader says about the element its cursor is on​

said = device.speech()
print(said["steps"][0]["said"])

The same call from the command line, mobium speech, printed on an Android 15 emulator:

TalkBack says: "not checked. Pro. Radio button" — Pro (radio)

Walk the screen in the screen reader's order, each sentence beside its element​

walk = device.speech(walk=True, limit=20)
for step in walk["steps"]:
print(step["said"], step.get("element", {}).get("label"))

The same call from the command line, mobium speech --walk --limit 20, printed on an Android 15 emulator:

TalkBack says:
1. "not checked. Team. Radio button" — Team (radio)
2. "OFF. Dark mode. Switch" — Dark mode (switch)
3. "Dark mode, for the whole app" — Dark mode, for the whole app, not in map
4. "Read-only" — Read-only, not in map
5. "This field cannot be edited. Edit box. disabled"
6. "notify=false terms=false plan=free theme=light" — notify=false terms=false plan=free theme=light, not in map
7. (nothing)
8. "Back. Button" — Back (button)
9. "Form" — Form, not in map
10. "not checked. Email me. Check box" — Email me (checkbox)
11. "not checked. Accept terms. Check box" — Accept terms (checkbox)
12. "checked. Free. Radio button" — Free (radio)
13. "not checked. Pro. Radio button" — Pro (radio)
ended: the cursor came back round to the first element

Put the screen reader's cursor on an element, and hear what it says​

said = device.speech("label=Pro")
print(said["steps"])

The same call from the command line, mobium speech label=Pro, printed on an Android 15 emulator:

TalkBack says: "not checked. Pro. Radio button" — Pro (radio)

mobium speech label=Pro on an Android 15 emulator

mobium speech label=Pro on an Android 15 emulator

Start listening to the screen reader, before an action​

device.speech(listen="start")
device.tap("testid=addLive")

The same call from the command line, mobium speech --listen start, printed on an Android 15 emulator:

listening to TalkBack — act, then stop it with listen stop

Stop listening, and hear what the action made it say​

heard = device.speech(listen="stop")
for step in heard["steps"]:
print(step["said"], step.get("cause"))

The same call from the command line, mobium speech --listen stop, printed on an Android 15 emulator:

TalkBack said, since listening started: "Live cart: 1" — Live cart: 1, not in map [a change on screen]