Amazon Polly TTS voice service

What do you see in openhab.log?

Yes Check the log file for something like this:

2018-01-15 12:13:18.613 [INFO ] [ce.pollytts.internal.PollyTTSService] -
PollyTTS voice service initialized

Hi Robert!

I have been playing with your addon for some time now and I have a small suggestion: One of the nicer feature of polly is the usage of SSML. This would allow commands like:

say("<speak>Children, come to dinner <prosody volume='x-loud'>Right now!</prosody></speak>")

:slight_smile:

Of course even more useful are pronounication and say-as tags.

The changes to your addon would be minimal (GitHub somehow didnā€™t like me to create a pull request just nowā€¦):

       TextType textType = text.startsWith("<speak>") ? TextType.Ssml : TextType.Text;
       SynthesizeSpeechRequest synthReq = new SynthesizeSpeechRequest().withTextType(textType).withText(text)
               .withVoiceId(voiceID).withOutputFormat(OutputFormat.fromValue(format));

Cheers,

Stephan

1 Like

I agree with your suggestion. I guess since my pull request to add Polly to openhab is still open you werenā€™t able to do a pull request. Iā€™ll check and see if the clock restarts if I update my pull request.

I added your code suggestion to my branch and generated a new pull request. I had to bump the version to snapshot 2.3. I verified it under openhab 2.2 but not 2.3. The SSML functionality is quite an enhancement. Thanks for the input. snapshot-2.3.0

You donā€™t have to create new pull request. Actually I think you shouldnā€™t.
If you have an open PR, just push your changes to the same branch, they will appear there.
BTW: you need to rebase to 2.3 on your old PR anyway before it can be mergedā€¦

i was trying to rebase with all the 2.3 updates before my code and do
the update. Somehow my git rollback deleted the old pull.

Weirdā€¦ Basically you rebase on master and force pushing, because the history changes on rebase.
After rebase local and remote branches diverge, but donā€™t pull before push (as suggested). Just push with --force.

I get this as well not available to choose as a default engine - did you work this out?

I just uninstalled my plugin and will use the marketplace to verify the
process.

Just verified the marketplace install works.
Please check the log file and verify the initalization:
grep pollytts /var/log/openhab2/openhab.log
correct startup should be:
"[ce.pollytts.internal.PollyTTSService] - PollyTTS voice service
initialized"

You can force a new initialization by changing a parameter like the
server location.

If you got an exception -> ā€œ[org.openhab.pollytts(214)] The modified
method has thrown an exceptionā€?
go back to the configuration > services> voice >pollytts configure tab
and go into expert mode and send me the parameters excluding the account
info and the results of the grep. But check your credentials as well.

OK sorted - sorry I saw it above a couple of times and assumed a problem but turned out I didnt give the IAM permissions to use Polly after I created the IAM. Once done it was all good.

I am using this with the chromecast binding (its funny - Amazon voice on a google home mini) and found I was getting an error
"Rule ā€˜TTS Testā€™: Cannot create enum from ā€œdefaultā€ value!ā€œ
when I changed the
"Optional User specified audio formatā€ parameter from nothing to
"Use system selected audio format" it started working. Looking at the parameter in advanced mode it was indeed setting a nothing value in simple mode to ā€œdefaultā€ in advanced for this - might help others

This voice is SOOOOOO much better than VoiceRSS

Iā€™ll have to check the documentation. The audio format in not optional
but required.

Hi, I just noticed that the Polly Marketplace bundle is in the binding section instead of the voice section. Is that intentional?

Did not know there was a voice section. Iā€™ll check it out when I get a
chance.

Iā€™ve been having an issue recently with this service and itā€™s interaction with the Sonos through the say() command with the Sonos as the sink. Somewhere around 50% of the time, it sends two URIs to the Sonos in rapid succession. This causes the Sonos to store the first URI as the URI to restore instead of what was actually playing (or in the queue). From the logs, the CurrentTrackURI goes from (whatever the Sonos was playing) -> URI1 -> URI2 -> URI1. When all is said and done, the Sonos app shows a UUID instead of the original track.
Any idea why this is happening?

Hi Robert! Thanks in advance for your work on the service/binding. Iā€™m trying to get things set up and am having some issues. (OH2.3 on an Ubuntu 18.04 vm with Zulu Java as per the instructions.)

First I created an AWS account, created an IAM user, granted it AmazonPollyFullAccess. I then installed the PollyTTS binding from the marketplace. I configured via PaperUI with they keys and using ā€˜disabledā€™ as the default.

Hereā€™s what Iā€™m seeing in the log:

2018-07-11 01:53:34.899 [WARN ] [org.openhab.voice.pollytts          ] - FrameworkEvent WARNING - org.openhab.voice.pollytts
2018-07-11 01:53:34.908 [ERROR] [org.openhab.voice.pollytts          ] - [org.openhab.pollytts(213)] The activate method has thrown an exception
        at org.openhab.voice.pollytts.internal.PollyTTSService.modified(PollyTTSService.java:75) ~[?:?]
        at org.openhab.voice.pollytts.internal.PollyTTSService.activate(PollyTTSService.java:63) ~[?:?]

Hereā€™s my config:

I feel like Iā€™m missing something obvious, but I canā€™t seem to figure it out. Any help would be appreciated.

Thanks!

~Mark

the audioformat of disabled is an obsolete option. It should be default.

That was it! I changed it to ā€˜defaultā€™, restarted OH and things seem to be working. Thanks!!

~Mark

Iā€™ve recently upgraded to 2.4.0M4 and Iā€™ve had to go back from the market install to the posted file. Is there any intention of putting this back into the market for 2.4?

1 Like