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.1.tar.gz (7.0 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.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ssml_maker-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 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.1.tar.gz
Algorithm Hash digest
SHA256 3f72669a31e88c1e46f2676aa56b4d03898e962c4898f058c9339a49852df63a
MD5 db9f625de2905fa481fa3e220da49bcf
BLAKE2b-256 49b0b0b4cbccfa59c1d22386c19093258d571df19b6245c0653f64c6f77358a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssml_maker-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 155787730b359960f8769fb746fe6aba3c21e41187043f5a96c956d5d215feaa
MD5 9dfad2e07a0c737fc4d7eee1221db7bd
BLAKE2b-256 897b6fb023a89194626ab5ba770cc0126f6ea2c92827a053e7ebcee2eac31f81

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