SSMD - Speech Synthesis Markdown

SSMD (Speech Synthesis Markdown) is a lightweight Python library that provides a human-friendly markdown-like syntax for creating SSML (Speech Synthesis Markup Language) documents. It’s designed to make TTS (Text-to-Speech) content more readable and maintainable. See SPECIFICATION.md in the repo for the canonical syntax rules.

PyPI Version Python Versions Code Coverage

Features

✨ Markdown-like syntax - More intuitive than raw SSML

🎯 Full SSML support - All major SSML features covered

πŸ”„ Bidirectional - Convert SSMD↔SSML or strip to plain text

πŸ“Š Parser API - Extract structured data for custom TTS pipelines

πŸ“ TTS streaming - Iterate through sentences for real-time TTS

πŸŽ›οΈ TTS capabilities - Auto-filter features based on engine support

🎨 Extensible - Custom extensions for platform-specific features

πŸ§ͺ Type-safe - Full mypy type checking support

Quick Example

import ssmd

# Convert SSMD to SSML
ssml = ssmd.to_ssml("Hello *world*!")
# β†’ <speak>Hello <emphasis>world</emphasis>!</speak>

# Convert SSML back to SSMD
ssmd_text = ssmd.from_ssml('<speak><emphasis>Hello</emphasis></speak>')
# β†’ *Hello*

# Strip markup for plain text
plain = ssmd.to_text("Hello *world* @marker!")
# β†’ Hello world!

# Or use the Parser API for structured data
from ssmd import parse_paragraphs

for paragraph in parse_paragraphs("Hello *world*!"):
    for sentence in paragraph.sentences:
        for seg in sentence.segments:
            print(f"Text: {seg.text}, Emphasis: {seg.emphasis}")

Table of Contents

Indices and tables