openhab-addons/bundles/org.openhab.voice.pollytts
Wouter Born fccfae81ee
[pollytts] Add default translations properties file (#11728)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-12-07 17:47:53 +01:00
..
src/main [pollytts] Add default translations properties file (#11728) 2021-12-07 17:47:53 +01:00
noEmbedDependencies.profile added migrated 2.x add-ons 2020-09-21 03:37:19 +02:00
NOTICE added migrated 2.x add-ons 2020-09-21 03:37:19 +02:00
pom.xml applied spotless 2021-06-27 23:25:35 +02:00
README.md [pollytts] Fix settings namespace in documentation (#10725) 2021-05-20 19:43:05 +02:00

Polly Text-to-Speech

PollyTTS is a voice service utilizing the Internet based text-to-speech (TTS) service Amazon Polly. The service generates speech from both plain text input and text with Speech Synthesis Markup Language (SSML) tags. There are servers set in various geographic regions. API keys provided by Amazon are required to get access to the service. Amazon Polly has a wide selection of voices and languages. Be aware, that using this service may incur costs on your AWS account. You can find pricing information on the documentation page.

Obtaining Credentials

  • Sign up for Amazon Web Services (AWS). link

When you sign up for AWS, your account is automatically signed up for all services in AWS, including Amazon Polly.

  • Create an IAM User. link

Services in AWS, such as Amazon Polly, require that you provide credentials when you access them so that the service can determine whether you have permissions to access the resources owned by that service. Within the AWS console, you can create access keys for your AWS account to access the Polly API.

To use the service you will need the access key, secret key and server region.

Service Configuration

The following configurations can be edited using the "Polly Text-to-Speech" settings in the UI:

  • Access Key - The AWS credentials access key (required).
  • Secret Key - The AWS credentials secret key (required).
  • Service Region - The service region used for accessing Polly (required). To reduce latency select the region closest to you. E.g. "eu-west-1" (see regions)

The PollyTTS service caches audio files from previous requests. This reduces traffic, improves performance, reduces the number of requests and provides offline functionality.

  • Cache Expiration - Cache expiration in days.

When cache files are used their time stamps are updated, unused files are purged if their time stamp exceeds the specified age. The default value of 0 disables this functionality. A value of 365 removes files that have been unused for a year.

  • Audio Format - Allows for overriding the system default audio format.

Use "default" to select the system default audio format. The default audio format can be overriden with the value "mp3" or "ogg".

Service Configuration via Text files

Create a new file in $OPENHAB_ROOT/conf/services named pollytts.cfg

It's contents should look similar to:

org.openhab.voice.pollytts:accessKey=ACCESS_KEY_ID
org.openhab.voice.pollytts:secretKey=SECRET_KEY
org.openhab.voice.pollytts:serviceRegion=SERVICE_REGION
org.openhab.voice.pollytts:cacheExpiration=EXPIRATION_IN_DAYS

These have the same meanings as described in the Service Configuration block above.

Rule Examples

say("Hello there")  
say("Hello there", "pollytts:Joanne", "enhancedjavasound")  
say("" + item.state, "pollytts:Joey", "enhancedjavasound")  
say("<speak>Children, come to dinner <prosody volume='x-loud'>Right now!</prosody></speak>")