ssml-builder
Installation
pip install ssml-builder
Usage
- Create Speech Object
from ssml_builder.core import Speech
speech = Speech()
- Add text
speech.add_text('sample text')
- Generate SSML
speech.speak()
Features
- This package supports the following SSML tags.
- say_as
- prosody
- sub
- lang
- voice
- pause
- whisper
- audio
- emphasis
- p
Tag Examples
say_as
speech = Speech()
speech.say_as(value='hello', interpret_as='spell-out')
speech.speak()
# <speak><say-as interpret-as="spell-out">hello</say-as><say-as interpret-as="spell-out">hello</say-as></speak>
prosody
speech = Speech()
speech.prosody(value="sample sentence", rate='70%', pitch='+50%', volume='x-soft')
speech.speak()
# <speak><prosody rate="70%" pitch="+50%" volume="x-soft">sample sentence</prosody></speak>
sub
speech = Speech()
speech.sub(value="Al", alias="aluminum")
speech.speak()
# <speak><sub alias="aluminum">Al</sub></speak>
lang
speech = Speech()
speech.lang(value="Paris", lang="fr-FR")
speech.speak()
# <speak><speak><lang xml:lang="fr-FR">Paris</lang></speak>
voice
speech = Speech()
speech.voice(value="I am not a real human.", name="Kendra")
speech.speak()
# <speak><voice name="Kendra">I am not a real human.</voice></speak>
pause
speech = Speech()
speech.add_text("There is a three second pause here ")
speech.pause(time="3s")
speech.add_text("then the speech continues.")
speech.speak()
# <speak>There is a three second pause here <break time="3s"/>then the speech continues.</speak>
whisper
speech = Speech()
speech.whisper("I am not a real human.")
speech.speak()
# <speak><amazon:effect name="whispered">I am not a real human.</amazon:effect></speak>
audio
speech = Speech()
speech.audio('soundbank://soundlibrary/transportation/amzn_sfx_car_accelerate_01')
speech.speak()
# <speak><audio src="soundbank://soundlibrary/transportation/amzn_sfx_car_accelerate_01" /></speak>
emphasis
speech = Speech()
speech.add_text('I already told you I ')
speech.emphasis('really like', 'strong')
speech.add_text(' that person')
speech.speak()
# <speak>I already told you I <emphasis level="strong">really like</emphasis> that person</speak>
p
speech = Speech()
speech.p("This is the first paragraph. There should be a pause after this text is spoken.")
speech.p("This is the second paragraph.")
# <speak><p>This is the first paragraph. There should be a pause after this text is spoken.</p><p>This is the second paragraph.</p></speak>
Metadata
Release files for ssml-builder 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ssml_builder-1.1.1.tar.gz | 3.4 kB | Without provenance | Details for ssml_builder-1.1.1.tar.gz |
Release files / ssml_builder-1.1.1.tar.gz
| Download URL | ssml_builder-1.1.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdc448ddd9a29aa161d28931ff25cd0ed0a3467227ded2fd2dc55cd1c34ae94d
|
|
BLAKE2b-256 checksum How to use checksums |
c6932e21d458166bb2e6fc65333754a01bc0116772b49b9be77059ae162b0ca8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for ssml-builder 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.