用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill text-to-speech命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | text-to-speech |
| description | Alex's voice synthesis capability for reading documents aloud Use when this capability is needed. |
| metadata | {"author":"fabioc-aloha"} |
Domain: AI Accessibility & Communication
Inheritance: inheritable (promote to Master Alex for all heirs)
Version: 2.0.0
Last Updated: 2026-02-05
Author: Alex (Master Alex)
Status: ⭐ Flagship Skill - Core Alex capability
Text-to-Speech gives Alex a voice. This transforms Alex from a text-only assistant into a multimodal companion that can:
Zero cost, zero dependencies - uses Microsoft Edge TTS (free, no API key) with native TypeScript.
Keyboard shortcut (fastest):
Ctrl+Alt+R (Windows/Linux) or Cmd+Alt+R (macOS)Command palette:
Ctrl+Shift+P → "Alex: Read Aloud"The status bar shows real-time progress during TTS operations:
| State | Display | Click Action |
|---|---|---|
| Connecting | $(loading~spin) Connecting... | - |
| Synthesizing | $(loading~spin) Synthesizing... | - |
| Streaming | $(loading~spin) Receiving... 45KB | - |
| Playing | $(unmute) Playing 35% | Stop |
| Paused | $(unmute) Paused | Stop |
A sleek panel opens with full playback controls:
┌─────────────────────────────────────────────────────────┐
│ Alex TTS Player [×] │
├─────────────────────────────────────────────────────────┤
│ │
│ ▶️ ⏹️ ═══════════●══════════ 1:23 / 4:56 │
│ │
│ 🔊 ────────●──────── │
│ │
└─────────────────────────────────────────────────────────┘
Features:
Choose Alex's voice before reading:
Ctrl+Shift+P → "Alex: Read with Voice Selection"| Voice | Character | Best For |
|---|---|---|
| Default (GuyNeural) | Professional, clear | Technical docs, code review |
| Warm (ChristopherNeural) | Friendly, conversational | Tutorials, READMEs |
| British (RyanNeural) | Authoritative | Formal documents, presentations |
| Friendly (DavisNeural) | Casual, approachable | Chat logs, informal content |
Export any document to audio file:
Ctrl+Shift+P → "Alex: Save as Audio"Use cases:
Multiple ways to stop playback:
$(unmute) icon during playback)Escape when readingCtrl+Shift+P → "Alex: Stop Reading"Alex automatically strips markdown formatting for natural speech:
| You Write | Alex Reads |
|---|---|
# Heading | "Heading." (pause) |
**bold text** | "bold text" (slight emphasis) |
[link text](url) | "link text" |
`code` | "code" |
> blockquote | "Quote: ..." |
--- | (long pause) |
Symbol conversion:
| Symbol | Spoken As |
|---|---|
~5 minutes | "about 5 minutes" |
50% | "50 percent" |
A → B | "A leads to B" |
±5% | "plus or minus 5 percent" |
This skill gives Alex a voice. Version 2.0 uses native TypeScript WebSocket integration with Microsoft Edge TTS, eliminating external dependencies. Reading documents aloud with natural-sounding neural voices.
Version 2.0 Changes:
Why promote to Master:
Dependencies (v2.0):
ws npm package (WebSocket client)Alex's voice synthesis capability using Microsoft Edge TTS via native TypeScript. Enables reading markdown documents, code files, and text aloud with natural-sounding voices. Fully integrated into the VS Code extension.
┌─────────────────────────────────────────────────────────────┐
│ Alex VS Code Extension │
├─────────────────────────────────────────────────────────────┤
│ │
│ Commands: │
│ • Alex: Read Aloud (Ctrl+Alt+R) │
│ • Alex: Read with Voice Selection │
│ • Alex: Save as Audio │
│ • Alex: Stop Reading │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────┐ │
│ │ ttsService.ts │ │
│ │ Native WebSocket to Edge TTS │ │
│ │ • SSML generation │ │
│ │ • Markdown stripping │ │
│ │ • Progress callbacks │ │
│ └─────────────────┬───────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────┐ │
│ │ audioPlayer.ts │ │
│ │ Webview-based playback │ │
│ │ • Cross-platform HTML5 Audio │ │
│ │ • Play/pause/stop controls │ │
│ │ • Progress tracking │ │
│ └─────────────────────────────────────────────┘ │
│ │
└──────────────────────┬──────────────────────────────────────┘
│ WebSocket (wss://)
▼
┌─────────────────────────────────────────────────────────────┐
│ Microsoft Edge TTS Endpoint │
│ wss://speech.platform.bing.com/consumer/speech/... │
├─────────────────────────────────────────────────────────────┤
│ • 400+ neural voices, 90+ languages │
│ • Free, no API key required │
│ • MP3 output (24kHz, 48kbps) │
│ • SSML support for prosody control │
└─────────────────────────────────────────────────────────────┘
| Preset | Voice ID | Character |
|---|---|---|
| Default | en-US-GuyNeural | Professional male, clear articulation |
| Warm | en-US-ChristopherNeural | Friendly, conversational |
| British | en-GB-RyanNeural | British accent, authoritative |
| Friendly | en-US-DavisNeural | Casual, approachable |
Alex's default voice (GuyNeural) was chosen for:
Command: alex.readAloud
Keybinding: Ctrl+Alt+R (Windows/Linux), Cmd+Alt+R (macOS)
Reads the current selection or entire document aloud using Alex's default voice.
Behavior:
Command: alex.readWithVoice
Quick pick to select a voice preset before reading.
Command: alex.saveAsAudio
Generate and save speech to an MP3 file. Opens a save dialog for output location.
Command: alex.stopReading
Keybinding: Escape (when reading)
Immediately stops current playback.
| File | Purpose |
|---|---|
ttsService.ts | WebSocket connection, SSML generation, synthesis |
audioPlayer.ts | Webview panel, playback controls, system fallback |
index.ts | Module exports |
The prepareTextForSpeech() function strips markdown:
| Markdown | Speech Output |
|---|---|
# Heading | "Heading." (pause) |
**bold** | "bold" (emphasis via prosody) |
*italic* | "italic" |
`code` | "code" |
[link]\(url\) | "link" |
- item | "Item." |
> quote | "Quote: ..." |
--- | (long pause) |
```python
def hello():
print("Hello")
Becomes: "Python code block. Definition hello. Print hello. End code block."
### Symbol-to-Speech Transformations
Symbols are converted to natural speech equivalents:
| Symbol | Spoken As | Example |
|--------|-----------|--------|
| `~` | "approximately" or "about" | ~2 min → "about 2 minutes" |
| `&` | "and" | A & B → "A and B" |
| `@` | "at" | user@email → "user at email" |
| `%` | "percent" | 50% → "50 percent" |
| `+` | "plus" | +10% → "plus 10 percent" |
| `→` | "leads to" or "becomes" | A → B → "A becomes B" |
| `—` | (pause) | word—word → "word (pause) word" |
| `#` | (context-dependent) | #1 → "number 1"; ## → (heading marker) |
| `<` / `>` | "less than" / "greater than" | x > 5 → "x greater than 5" |
| `≥` / `≤` | "greater than or equal" / "less than or equal" | |
| `µ` | "micro" | µg → "microgram" |
| `°` | "degrees" | 37°C → "37 degrees celsius" |
| `±` | "plus or minus" | ±5% → "plus or minus 5 percent" |
**Design Principle**: Would a human reading this aloud say the symbol name, or translate it to meaning? Almost always the latter.
---
## Installation (v2.0)
TTS v2 is built into the Alex VS Code extension. No separate installation required.
### Package Dependencies
The extension automatically includes:
- `ws` (WebSocket client for Edge TTS connection)
- `fs-extra` (file operations for audio saving)
### Verification
After extension update, verify TTS works:
1. Open any document
2. Press `Ctrl+Alt+R` (Windows/Linux) or `Cmd+Alt+R` (macOS)
3. Status bar should show "$(unmute) Synthesizing..."
4. Audio should play through webview panel
---
## Usage Patterns
### Read Current Document
Press Ctrl+Alt+R to read document aloud Select text first to read only selection
### Generate Audio File
Command Palette → "Alex: Save as Audio" Choose output location → MP3 saved
### Voice Customization
Command Palette → "Alex: Read with Voice Selection" Choose: Default | Warm | British | Friendly
---
## Edge TTS Technical Reference
### WebSocket Endpoint
wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1 ?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4 &ConnectionId=[UUID]
### Audio Format
- **Codec**: MP3
- **Sample Rate**: 24kHz
- **Bitrate**: 48kbps mono
### SSML Template
```xml
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
<voice name="en-US-GuyNeural">
<prosody rate="+0%" pitch="+0Hz" volume="+0%">
Text content here
</prosody>
</voice>
</speak>
| Language | Voice | Style |
|---|---|---|
| en-US | GuyNeural | Professional male |
| en-US | JennyNeural | Professional female |
| en-US | AriaNeural | News anchor style |
| en-GB | RyanNeural | British male |
| en-GB | SoniaNeural | British female |
| en-AU | WilliamNeural | Australian male |
| en-IN | NeerjaNeural | Indian English |
| Use Case | Benefit |
|---|---|
| Vision impaired | Full document access via audio |
| Multitasking | Review code while walking/driving |
| Learning | Auditory reinforcement of reading |
| Proofreading | Catch errors by hearing text |
| Long documents | Listen during breaks |
| Feature | Status | Notes |
|---|---|---|
| Real-time streaming | Planned | Start playing before full generation |
| SSML support | Planned | Fine-grained prosody control |
| Section navigation | Planned | "Skip to next heading" |
| Bookmark resume | Planned | Resume from last position |
| Speed presets | Planned | 1x, 1.5x, 2x reading speeds |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.