An open API service indexing awesome lists of open source software.

https://github.com/alyshmahell/zzml

SSML (Speech Synthesis Markup Language) Preprocessor/Interpreter/Compiler.
https://github.com/alyshmahell/zzml

ssml ssml-parser ssml-parsing work-in-progress

Last synced: 3 months ago
JSON representation

SSML (Speech Synthesis Markup Language) Preprocessor/Interpreter/Compiler.

Awesome Lists containing this project

README

          

# zzml
- SSML (Speech Synthesis Markup Language) Preprocessor/Interpreter/Compiler.
- **work in progress**
## Requirements
```sh
sudo apt update && sudo apt install g++ flex bison python3-dev
```
## Installation
```sh
pip install git+https://github.com/AlyShmahell/zzml.git
```
## Example
```py
from zzml import zzml

print(
zzml(
"""





Hello, this is an example of a complex SSML document.
This text will be spoken with strong emphasis.
This text will be spoken at a slower pace.



This is a paragraph break with a 2-second pause.
January 1, 2022
12:30 PM




This is another paragraph with a 1-second pause.
This is another paragraph.





"""
)
)

```

result:
```sh
{
"func": {
"0": {
"name": "?xml",
"params": [
"version=\"1.0\"",
"encoding=\"UTF-8\"",
"?"
]
},
"1": {
"name": "ssml",
"params": []
},
"10": {
"name": "say-as",
"params": [
"interpret-as=\"time\""
]
},
"11": {
"name": "p",
"params": []
},
"12": {
"name": "break",
"params": [
"time=\"1s\""
]
},
"13": {
"name": "phoneme",
"params": [
"alphabet=\"ipa\"",
"ph=\"tɪm ɪz ən ɔðər pɑrəɡræf\""
]
},
"2": {
"name": "speak",
"params": []
},
"3": {
"name": "p",
"params": []
},
"4": {
"name": "break",
"params": [
"time=\"1s\""
]
},
"5": {
"name": "emphasis",
"params": [
"level=\"strong\""
]
},
"6": {
"name": "prosody",
"params": [
"rate=\"slow\""
]
},
"7": {
"name": "p",
"params": []
},
"8": {
"name": "break",
"params": [
"time=\"2s\""
]
},
"9": {
"name": "say-as",
"params": [
"interpret-as=\"date\""
]
}
},
"text": {
"0": {
"ops": [
"3",
"2",
"1",
"0"
],
"val": " Hello, this is an example of a complex SSML document."
},
"1": {
"ops": [
"5",
"3",
"2",
"1",
"0"
],
"val": "This text will be spoken with strong emphasis."
},
"2": {
"ops": [
"6",
"3",
"2",
"1",
"0"
],
"val": "This text will be spoken at a slower pace."
},
"3": {
"ops": [
"7",
"3",
"2",
"1",
"0"
],
"val": " This is a paragraph break with a 2-second pause."
},
"4": {
"ops": [
"9",
"7",
"3",
"2",
"1",
"0"
],
"val": "January 1, 2022"
},
"5": {
"ops": [
"10",
"7",
"3",
"2",
"1",
"0"
],
"val": "12:30 PM"
},
"6": {
"ops": [
"11",
"3",
"2",
"1",
"0"
],
"val": " This is another paragraph with a 1-second pause."
},
"7": {
"ops": [
"13",
"11",
"3",
"2",
"1",
"0"
],
"val": "This is another paragraph."
}
}
}
```