Screen Reader Speech Generation Pipeline
Overview
The goal of this subsystem is to transform a raw UI Automation (UIA) element into a meaningful spoken description that helps users understand:
What the element is
What the element does
Where the element belongs
Whether the element is actionable
Additional contextual information
Fallback information when accessibility data is incomplete
The system should not simply read the UIA Name property.
Instead, it should build a semantic description from multiple accessibility and contextual sources.
Design Goals
Primary Goals
Produce meaningful speech for most UI elements
Recover gracefully when accessibility information is missing
Support application-specific enhancements
Support configurable verbosity levels
Support future OCR integration
Non-Goals
Pipeline
UIA Element
│
▼
Element Analyzer
│
├─ Accessibility Data
├─ Context Analysis
├─ Rule Engine
├─ OCR Fallback
│
▼
Speech Description
│
▼
TTS Provider
Data Collection
Core UIA Properties
Collect all available information from the target element.
Name
ControlType
LocalizedControlType
AutomationId
HelpText
FrameworkId
BoundingRectangle
IsEnabled
IsOffscreen
Patterns
Attempt to retrieve:
ValuePattern
TogglePattern
SelectionItemPattern
ExpandCollapsePattern
RangeValuePattern
InvokePattern
Legacy Accessibility
Fallback to:
IAccessible.accName
IAccessible.accDescription
IAccessible.accValue
Speech Model
public sealed class SpeechDescription
{
public string? Label { get; init; }
public string? ControlType { get; init; }
public string? State { get; init; }
public string? Context { get; init; }
public string? Tooltip { get; init; }
public string? Warning { get; init; }
public double Confidence { get; init; }
}
Example:
{
"label": "Google Chrome",
"controlType": "button",
"state": "running",
"context": "Windows taskbar",
"tooltip": "Switch to Google Chrome",
"confidence": 0.98
}
Rule Engine
The speech generation system should be based on independent rules.
Each rule contributes information to the final speech description.
TaskbarRule
ButtonRule
CheckBoxRule
MenuRule
TooltipRule
AdminRule
OCRRule
Rules should be composable and independent.
Control Type Rules
Button
Input:
Name = Open
ControlType = Button
Output:
CheckBox
Input:
Name = Remember me
Checked = true
Output:
Remember me checkbox, checked
RadioButton
Output:
Dark theme radio button, selected
Edit Box
Read:
Name
Current Value
ReadOnly State
Output:
Search edit box, text Visual Studio
Slider
Output:
Volume slider, 70 percent
Progress Bar
Output:
Download progress, 45 percent
Tree View Item
Output:
Documents tree item, expanded
Menu Item
Output:
or
Save menu item in File menu
Tab Item
Output:
Context Analysis
Users often need context to understand an element.
Example:
Without context:
With context:
Open button in File Explorer toolbar
Parent Hierarchy Analysis
Walk up the UIA tree.
Example:
Button
└ Toolbar
└ File Explorer
Generated context:
Taskbar Recognition
Detect taskbar elements.
Possible indicators:
Shell_TrayWnd
MSTaskListWClass
Explorer.exe
Example output:
Google Chrome button on Windows taskbar
Additional state:
Example:
Visual Studio button on Windows taskbar, active
Tooltip Integration
Tooltips often contain valuable descriptions.
Sources:
UIA HelpText
Tooltip Window
IAccessible Description
Example:
Refresh button. Reload current page.
Avoid duplicated speech.
Bad:
Good:
Refresh button. Reload current page.
Permission Awareness
Some applications expose limited accessibility information when running elevated.
Detect:
Target Process Elevated
Current Process Not Elevated
Speech:
Limited accessibility information available.
Administrator privileges may be required.
Example:
Visual Studio window.
Administrator privileges may be required.
Empty Name Recovery
Many applications expose controls without accessible names.
A fallback chain should be used.
Priority Order
1. Name
2. Value Pattern
3. Legacy Accessibility
accName
accDescription
accValue
4. Associated Label Detection
Example:
Output:
5. Parent Context
Example:
Unnamed button in Visual Studio
6. Process Name
Example:
Unnamed element in explorer.exe
7. Window Title
Example:
Unnamed element in Settings
8. Position Description
Example:
Unnamed element near top left corner
9. OCR
Capture:
Perform OCR.
Output:
Speech:
Download, detected from screen text
OCR Integration
OCR should be considered a last resort.
Conditions:
Name Missing
AND
No Value Pattern
AND
No Label Association
Suggested workflow:
Capture Element Bounds
│
▼
OCR Engine
│
▼
Text Candidate
│
▼
Speech Builder
OCR-derived content should always be identified as inferred content.
Confidence Scoring
Each generated speech description should include a confidence score.
| Source |
Confidence |
| UIA Name |
100% |
| Value Pattern |
95% |
| HelpText |
90% |
| Label Association |
85% |
| Parent Context |
70% |
| OCR |
50% |
| Position Only |
20% |
This score can determine:
Verbosity Levels
Compact
Minimal information.
Example:
Normal
Default mode.
Example:
Open button in File Explorer toolbar
Detailed
Include all available information.
Example:
Open button.
File Explorer toolbar.
Shortcut Control O.
Enabled.
Application-Specific Extensions
Support application-specific speech enhancements.
Examples:
Windows Taskbar
Visual Studio
Chrome
Edge
Office
Explorer
Architecture:
public interface IElementSpeechRule
{
bool CanHandle(ElementContext context);
void Apply(
ElementContext context,
SpeechDescriptionBuilder builder);
}
Examples:
TaskbarSpeechRule
ChromeSpeechRule
ExplorerSpeechRule
VisualStudioSpeechRule
These rules can be loaded dynamically and registered through dependency injection.
Example Outputs
Example 1
Input:
Output:
Example 2
Input:
Taskbar Button
Name = Visual Studio
Output:
Visual Studio button.
Windows taskbar.
Running.
Example 3
Input:
Edit Box
Name = Search
Value = Accessibility
Output:
Search edit box.
Text Accessibility.
Example 4
Input:
Name Missing
OCR Result = Download
Output:
Download.
Detected from screen text.
Future Enhancements
AI-assisted element summarization
Browser DOM integration
Live region support
Table navigation support
Accessibility diagnostics mode
User-customizable speech templates
Multilingual speech generation
Screen understanding based on OCR + UIA fusion
Screen Reader Speech Generation Pipeline
Overview
The goal of this subsystem is to transform a raw UI Automation (UIA) element into a meaningful spoken description that helps users understand:
What the element is
What the element does
Where the element belongs
Whether the element is actionable
Additional contextual information
Fallback information when accessibility data is incomplete
The system should not simply read the UIA
Nameproperty.Instead, it should build a semantic description from multiple accessibility and contextual sources.
Design Goals
Primary Goals
Produce meaningful speech for most UI elements
Recover gracefully when accessibility information is missing
Support application-specific enhancements
Support configurable verbosity levels
Support future OCR integration
Non-Goals
Full screen understanding
AI-based UI reasoning
Replacing UI Automation
Pipeline
Data Collection
Core UIA Properties
Collect all available information from the target element.
Patterns
Attempt to retrieve:
Legacy Accessibility
Fallback to:
Speech Model
Example:
Rule Engine
The speech generation system should be based on independent rules.
Each rule contributes information to the final speech description.
Rules should be composable and independent.
Control Type Rules
Button
Input:
Output:
CheckBox
Input:
Output:
RadioButton
Output:
Edit Box
Read:
Name
Current Value
ReadOnly State
Output:
Slider
Output:
Progress Bar
Output:
Tree View Item
Output:
Menu Item
Output:
or
Tab Item
Output:
Context Analysis
Users often need context to understand an element.
Example:
Without context:
With context:
Parent Hierarchy Analysis
Walk up the UIA tree.
Example:
Generated context:
Taskbar Recognition
Detect taskbar elements.
Possible indicators:
Example output:
Additional state:
Example:
Tooltip Integration
Tooltips often contain valuable descriptions.
Sources:
Example:
Avoid duplicated speech.
Bad:
Good:
Permission Awareness
Some applications expose limited accessibility information when running elevated.
Detect:
Speech:
Example:
Empty Name Recovery
Many applications expose controls without accessible names.
A fallback chain should be used.
Priority Order
1. Name
2. Value Pattern
3. Legacy Accessibility
4. Associated Label Detection
Example:
Output:
5. Parent Context
Example:
6. Process Name
Example:
7. Window Title
Example:
8. Position Description
Example:
9. OCR
Capture:
Perform OCR.
Output:
Speech:
OCR Integration
OCR should be considered a last resort.
Conditions:
Suggested workflow:
OCR-derived content should always be identified as inferred content.
Confidence Scoring
Each generated speech description should include a confidence score.
This score can determine:
Whether OCR is necessary
Whether speech should be cached
Whether diagnostic logging is required
Verbosity Levels
Compact
Minimal information.
Example:
Normal
Default mode.
Example:
Detailed
Include all available information.
Example:
Application-Specific Extensions
Support application-specific speech enhancements.
Examples:
Architecture:
Examples:
These rules can be loaded dynamically and registered through dependency injection.
Example Outputs
Example 1
Input:
Output:
Example 2
Input:
Output:
Example 3
Input:
Output:
Example 4
Input:
Output:
Future Enhancements
AI-assisted element summarization
Browser DOM integration
Live region support
Table navigation support
Accessibility diagnostics mode
User-customizable speech templates
Multilingual speech generation
Screen understanding based on OCR + UIA fusion