@pie-players/pie-tool-tts-inline 0.3.44 → 0.3.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/dist/tool-tts-inline.js +983 -911
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Inline TTS (Text-to-Speech) tool component for PIE Players Assessment Toolkit.
|
|
4
4
|
|
|
5
|
+
For the shared TTS architecture and provider model, see
|
|
6
|
+
[TTS Architecture](../../docs/accessibility/tts-architecture.md). This README
|
|
7
|
+
focuses on the inline custom element API.
|
|
8
|
+
|
|
5
9
|
## Overview
|
|
6
10
|
|
|
7
11
|
`pie-tool-tts-inline` is a web component that renders an inline speaker trigger with an expanded floating control panel for reading controls. Unlike floating modal tools, this component renders at its natural position in the DOM (typically in passage/item headers).
|
|
@@ -122,7 +126,7 @@ Semantics:
|
|
|
122
126
|
2. **Text Extraction**: Finds nearest `.pie-section-player__passage-content` or `.pie-section-player__item-content` container
|
|
123
127
|
3. **TTS Trigger**: Calls `ttsService.speak(text, { catalogId, language })`
|
|
124
128
|
4. **Catalog Resolution**: TTSService checks for SSML in accessibility catalogs (priority order):
|
|
125
|
-
- **Extracted catalogs** (from embedded SSML) -
|
|
129
|
+
- **Extracted catalogs** (from embedded SSML) - generated before render by hosts that run `SSMLExtractor`
|
|
126
130
|
- **Item-level catalogs** (manually authored)
|
|
127
131
|
- **Assessment-level catalogs** (manually authored)
|
|
128
132
|
- **Plain text fallback** (browser TTS)
|
|
@@ -140,7 +144,8 @@ Semantics:
|
|
|
140
144
|
|
|
141
145
|
## SSML Extraction Integration
|
|
142
146
|
|
|
143
|
-
When used with the section player, this tool
|
|
147
|
+
When used with the section player, this tool benefits from extracted catalogs
|
|
148
|
+
when a host/import pipeline runs `SSMLExtractor` before render:
|
|
144
149
|
|
|
145
150
|
**Author embeds SSML in content:**
|
|
146
151
|
```html
|
|
@@ -150,10 +155,10 @@ When used with the section player, this tool automatically benefits from SSML ex
|
|
|
150
155
|
</div>
|
|
151
156
|
```
|
|
152
157
|
|
|
153
|
-
**
|
|
158
|
+
**Preprocessing extracts SSML:**
|
|
154
159
|
- Generates catalog with ID like `auto-prompt-q1-0`
|
|
155
|
-
- Adds `data-catalog-
|
|
156
|
-
-
|
|
160
|
+
- Adds `data-catalog-idref="auto-prompt-q1-0"` to visual content
|
|
161
|
+
- Provides `config.extractedCatalogs` for runtime catalog registration
|
|
157
162
|
|
|
158
163
|
**Tool uses extracted catalog:**
|
|
159
164
|
- User clicks TTS button in header
|