https://github.com/infomofo/scala-ssml
A package for composing SSML fragments in scala
https://github.com/infomofo/scala-ssml
alexa-skills ssml text-to-speech
Last synced: 4 months ago
JSON representation
A package for composing SSML fragments in scala
- Host: GitHub
- URL: https://github.com/infomofo/scala-ssml
- Owner: infomofo
- Created: 2019-02-17T03:22:42.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-11-17T15:55:16.000Z (7 months ago)
- Last Synced: 2025-11-17T17:33:19.593Z (7 months ago)
- Topics: alexa-skills, ssml, text-to-speech
- Language: Scala
- Size: 37.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
scala-ssml
==========

This library allows you to easily generate Speech Synthesis Markup Language (SSML) with Scala.
SSML is documented [here](http://www.w3.org/TR/speech-synthesis),
but it has applications for:
- Alexa Skills (which only supports a subset of the official ssml tags, documented [here](https://developer.amazon.com/docs/custom-skills/speech-synthesis-markup-language-ssml-reference.html))
- Chrome Browser speechSynthesis fragments, documented [here](https://developer.chrome.com/extensions/tts)
Dependency
----------
This dependency can be imported into any scala project using:
```scala
lazy val scalaSsml = RootProject(uri("git://github.com/infomofo/scala-ssml.git#v0.4.0"))
```
The library is currently compiled for scala versions `2.11.12`, `2.12.11`, and `2.13.2`.
Basic Usage
------------
You can generate ssml for any of the use cases outlined above.
This library makes use of method chaining for convenience.
```scala
import com.infomofo.scalassml.SSMLBuilder
SSMLBuilder()
.text("hello")
.pause(1000)
.text("goodbye")
```
The output of a command like that would be:
```xml
hello
goodbye
```
Running Tests
-------------
Tests can be run using `sbt test`.
Testing SSML pronunciation
--------------------------
Generated SSML can be tested using Amazon's online tool at:
`https://developer.amazon.com/alexa/console/ask/test//development/en_US/`
where `` is the id of an alexa skill.