Skip to main content

A Python library for building SSML (Speech Synthesis Markup Language) documents

Project description

SSML Maker

A Python library for building SSML (Speech Synthesis Markup Language) documents with a fluent interface.

Installation

pip install ssml-maker

Features

  • Fluent interface for building SSML documents
  • Support for all major SSML elements
  • Type hints and proper documentation
  • Comprehensive test coverage
  • Input validation and error handling

Quick Start

from ssml_maker import Speech, InterpretAs, ProsodyConfig, ProsodyRate

# Create a simple SSML document
with Speech() as speech:
    speech.add_text("Here are ")
    with speech.say_as(InterpretAs.CHARACTERS):
        speech.add_text("SSML")
    speech.add_text(" examples")

# Get the SSML string
ssml_string = speech.build()
print(ssml_string)

Advanced Usage

Prosody Control

from ssml_maker import ProsodyConfig, ProsodyRate, ProsodyPitch, VolumeLevel

config = ProsodyConfig(
    rate=ProsodyRate.FAST,
    pitch=ProsodyPitch.HIGH,
    volume=VolumeLevel.LOUD
)

with Speech() as speech:
    with speech.prosody(config):
        speech.add_text("This will be spoken quickly, with high pitch and loud volume")

Voice Selection

with Speech() as speech:
    with speech.voice(name="Joanna", language="en-US", gender="female"):
        speech.add_text("This text will be spoken by Joanna")

Phonetic Pronunciation

from ssml_maker import PhoneticAlphabet

with Speech() as speech:
    with speech.phoneme(PhoneticAlphabet.IPA, "pɪˈkɑːn"):
        speech.add_text("pecan")

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssml_maker-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssml_maker-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file ssml_maker-0.1.0.tar.gz.

File metadata

  • Download URL: ssml_maker-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ssml_maker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 09d98720de6e8ba37955e5ff26be2da58557cc242e7ab0911dc2028be20808f2
MD5 d5c873793662b1e24403051e6e4665d6
BLAKE2b-256 99d12124adfa9a96b3865b2c91043bae783d3e2f776633c1cac19685bca8da87

See more details on using hashes here.

File details

Details for the file ssml_maker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ssml_maker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for ssml_maker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 482e53cddb05079271b63b65d8c20cf69bd37fa9b8d6c97cb7c8436a318a812c
MD5 31bdbb123a72e23e9c568eca37501462
BLAKE2b-256 e0b8c7602a231168a745e8f6c96dddea54ebe04f6d097efd2924d13552c97736

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page