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

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

Awesome Lists containing this project

README

          

scala-ssml
==========

![Scala CI](https://github.com/infomofo/scala-ssml/workflows/Scala%20CI/badge.svg)

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.