New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of new TTS module (AWS Polly). #1681

Merged
merged 21 commits into from Mar 2, 2017

Conversation

Projects
None yet
5 participants
@rlimonta
Collaborator

rlimonta commented Jan 1, 2017

No description provided.

@otsakir otsakir added the Peer Review label Jan 1, 2017

@deruelle

This comment has been minimized.

Member

deruelle commented Jan 2, 2017

Thanks @rlimonta. @gvagenas @leftyb can you review ?

@deruelle deruelle requested review from gvagenas and leftyb Jan 2, 2017

@leftyb

This comment has been minimized.

Contributor

leftyb commented Jan 6, 2017

Hi @rlimonta,

I am reviewing the integration for AWS Polly tts. I am not able to actually activate the awspolly system. RestComm is looking for the voicerss key even if I set the options that you provide above.
I think that you are missing one part. If you see at the restcomm.conf file you need to specify which system for RestComm to use: here

So what you need to do is to define a system name like awspolly (that will be used at the rescomm,conf) in order to set RestComm to actually use the specific TTS system.

Regards

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Jan 6, 2017

Added the awspolly key in the restcomm.conf file

@leftyb

This comment has been minimized.

Contributor

leftyb commented Jan 9, 2017

@rlimonta ,

I am testing the latest modification and still getting same issues. In order to activate the specific TTS system you need to provide modifications for the RC configuration scripts. like here.

We need to be able to configure properly file restcomm.xml to use the specific TTS system.
The reason that we want to add the awspolly at retcomm.conf is to be able to properly configure RC when running. So as well the configuration scripts need to be modified/updated for the awspolly system.

There are some problems with the pom.files:
1.) You need to add the module as dependency at the restcomm.application pom file.
2.) There are some warnings about duplicate declarations :
[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version ${junit.version} @ org.restcomm:restcomm-connect:8.1.0-SNAPSHOT, /tmp/workspace/restcomm/pom.xml, line 396, column 16
3.) You need to change the version of restcomm-connect at the awspolly pom file to <version>8.1.0-SNAPSHOT</version>

Apart from that, even if I manually configure restcomm.xml file I get errors :
`
Caused by: java.lang.IllegalArgumentException: No enum constant com.amazonaws.regions.Regions.US-EAST-1
at java.lang.Enum.valueOf(Enum.java:236) [rt.jar:1.7.0_95]
at com.amazonaws.regions.Regions.valueOf(Regions.java:26) [aws-java-sdk-core-1.11.76.jar:]
at org.restcomm.connect.tts.awspolly.AWSPollySpeechSyntetizer.(AWSPollySpeechSyntetizer.java:75) [restcomm-connect.tts.awspolly-8.0.0.rlimonta-master-local.jar:8.0.0.rlimonta-master-local]
... 18 more

`

If I dont set any region I get that Caused by: java.lang.IllegalArgumentException: No enum constant com.amazonaws.regions.Regions. at java.lang.Enum.valueOf(Enum.java:236) [rt.jar:1.7.0_95] at com.amazonaws.regions.Regions.valueOf(Regions.java:26) [aws-java-sdk-core-1.11.76.jar:] at org.restcomm.connect.tts.awspolly.AWSPollySpeechSyntetizer.<init>(AWSPollySpeechSyntetizer.java:75) [restcomm-connect.tts.awspolly-8.0.0.rlimonta-master-local.jar:8.0.0.rlimonta-master-local] ... 18 more
Instead of the default region value.

Regards

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Jan 15, 2017

@leftyb done. Let me know if there's any more.

@leftyb

This comment has been minimized.

Contributor

leftyb commented Jan 16, 2017

Hi @rlimonta,

I am reviewing the latest modifications and still getting same errors:
1.) You need to add the module as dependency at the restcomm.application pom file.
2.) ```
Caused by: java.lang.IllegalArgumentException: No enum constant com.amazonaws.regions.Regions.US-EAST-1
at java.lang.Enum.valueOf(Enum.java:236) [rt.jar:1.7.0_95]
at com.amazonaws.regions.Regions.valueOf(Regions.java:26) [aws-java-sdk-core-1.11.66.jar:]
at org.restcomm.connect.tts.awspolly.AWSPollySpeechSyntetizer.(AWSPollySpeechSyntetizer.java:75) [restcomm-connect.tts.awspolly-8.0.0.rlimonta-master-local.jar:8.0.0.rlimonta-master-local]

Can you please make sure that you pushed the correct modifications?

Regards.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Jan 17, 2017

@leftyb Fixed. Sorry for the inconvenience.

@leftyb

This comment has been minimized.

Contributor

leftyb commented Jan 20, 2017

@rlimonta
Still getting errors:

Current State: checkingCache
, Processing Message: org.restcomm.connect.commons.cache.DiskCacheResponse
13:01:43,832 ERROR [org.restcomm.connect.tts.awspolly.AWSPollySpeechSyntetizer] (RestComm-akka.actor.default-dispatcher-16) Name is null: java.lang.NullPointerException: Name is null
        at java.lang.Enum.valueOf(Enum.java:235) [rt.jar:1.7.0_95]
        at com.amazonaws.services.polly.model.VoiceId.valueOf(VoiceId.java:18) [aws-java-sdk-polly-1.11.66.jar:]
        at org.restcomm.connect.tts.awspolly.AWSPollySpeechSyntetizer.synthesize(AWSPollySpeechSyntetizer.java:185) [restcomm-connect.tts.awspolly-8.0.0.rlimonta-master-local.jar:8.0.0.rlimonta-master-local]
        at org.restcomm.connect.tts.awspolly.AWSPollySpeechSyntetizer.onReceive(AWSPollySpeechSyntetizer.java:148) [restcomm-connect.tts.awspolly-8.0.0.rlimonta-master-local.jar:8.0.0.rlimonta-master-local]
        at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:159) [akka-actor_2.10-2.1.2.jar:]
        at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425) [akka-actor_2.10-2.1.2.jar:]
        at akka.actor.ActorCell.invoke(ActorCell.scala:386) [akka-actor_2.10-2.1.2.jar:]
        at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230) [akka-actor_2.10-2.1.2.jar:]
        at akka.dispatch.Mailbox.run(Mailbox.scala:212) [akka-actor_2.10-2.1.2.jar:]
        at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506) [akka-actor_2.10-2.1.2.jar:]
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) [scala-library-2.10.1.jar:]
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [scala-library-2.10.1.jar:]
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) [scala-library-2.10.1.jar:]
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [scala-library-2.10.1.jar:]

13:01:43,873 INFO  [org.restcomm.connect.telephony.ua.UserAgentManager] (RestComm-akka.actor.default-dispatcher-13) UserAgentManager Processing Message: "akka.actor.ReceiveTimeout$ sender : class akka.actor.DeadLetterActorRef self is terminated: false
@leftyb

This comment has been minimized.

Contributor

leftyb commented Jan 20, 2017

@rlimonta There is a different error appearing as well not directly linked with the TTS but still affected by the dependencies that the project is using. If you try to login at the AdminUI, you will see that there is an exception that prevents from logging in to AdmiUI. It seems that it has something to do (conflict) with the dependencies that are used at the AWS Polly project. You can easilly reproduce if you just try to login at adminUI. Here the exception:

12:58:49,945 SEVERE [com.sun.jersey.spi.inject.Errors] (http-/192.168.1.6:8080-5) The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Missing dependency for field: private org.glassfish.jersey.server.wadl.WadlApplicationContext org.glassfish.jersey.server.wadl.internal.WadlResource.wadlContext
12:58:49,951 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/restcomm].[Jersey]] (http-/192.168.1.6:8080-5) JBWEB000235: Allocate exception for servlet Jersey: com.sun.jersey.spi.inject.Errors$ErrorMessagesException
        at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170) [jersey-core-1.13.jar:1.13]
        at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136) [jersey-core-1.13.jar:1.13]
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199) [jersey-core-1.13.jar:1.13]
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:765) [jersey-server-1.13.jar:1.13]
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:760) [jersey-server-1.13.jar:1.13]
        at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:489) [jersey-servlet-1.13.jar:1.13]
        at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:319) [jersey-servlet-1.13.jar:1.13]
        at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609) [jersey-servlet-1.13.jar:1.13]
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210) [jersey-servlet-1.13.jar:1.13]
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374) [jersey-servlet-1.13.jar:1.13]
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557) [jersey-servlet-1.13.jar:1.13]
        at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:950) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:151) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.mobicents.servlet.sip.startup.SipStandardContextValve.invoke(SipStandardContextValve.java:263)
        at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_95]
@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Jan 20, 2017

@leftyb I'll check and return to you soon.

@deruelle

This comment has been minimized.

Member

deruelle commented Feb 1, 2017

@rlimonta were you able to make progress on this ?

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 1, 2017

@deruelle I found the problem last night. I'll fix it today.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 2, 2017

@deruelle @leftyb Guys, I solved the dependency problems, but I noticed that the TTS module receives only the (en) language, even if you select another.

Now it´s working correctly. I liked the response time!

@gvagenas

This comment has been minimized.

Collaborator

gvagenas commented Feb 6, 2017

Hi @rlimonta , thanks for the contribution. Can you please merge your banch with master to get the latest and then push it again so I can proceed to do the final review and merge.

Thanks
George

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 6, 2017

Ok @gvagenas, I'll do it today.

@otsakir

This comment has been minimized.

Contributor

otsakir commented Feb 14, 2017

@rlimonta , can you provide the offending RCML generated from the RVD project to take a look? You can easily get the RCML by clicking on 'App URL' while editing the RVD project.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 14, 2017

@leftyb @otsakir I believe the problem is in the languages combobox. The content is different from my implementation.

Look:

screen shot 2017-02-14 at 9 39 27 am

This is my implementation:

restcom.xml
aws_polly_config

AWSPollySpeechSyntetizer.java
aws_polly_languages_load

aws_polly_keyset

Did I forget something?

Thank you for your help!

@otsakir

This comment has been minimized.

Contributor

otsakir commented Feb 14, 2017

@rlimonta

  1. As far as i tested, voice RSS TTS plugin works ok with language codes produced from RVD. Was there any language you tried that failed? Which one ? I'm interested on the exact RCML including the code.
  2. I suspect that the problem with the new TTS extension has to do with the fact that RVD generates two digit language codes like "en" or "fr" for some (most) languages. As far as i investigated these are further mapped to "en-us" and "fr-fr" from "VoiceRSSSpeechSynthesizer". If AWSPollySpeechSyntetizer doesn't do such a mapping, then that's probably what's causing the problem. Can you confirm this assumption ?

You may experiment with static rcml files to iterate faster.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 14, 2017

@otsakir The VoiceRSS did not work for the en pt-BR language (Brazilian Portuguese). Using two digits would be a problem because I have variations in several languages, such as Portuguese, French, Spanish and English.

@otsakir

This comment has been minimized.

Contributor

otsakir commented Feb 14, 2017

thanks @rlimonta.

Different TTS providers may use different language identifier conventions. English may be understood as "en", "en-us" or "eng" depending on provider. For this reason the TTS plugin (like voice rss) usually takes care of mapping the language identifier used in RCML to the one understood by the provider. The idea is not to propagate the language identifier literaly as it was included in the RCML.

For example, here is how :

https://github.com/RestComm/RestComm-Connect/blob/1f5637cb21dfba9d324188dfab4ba5482fd36c08/restcomm/restcomm.tts.voicerss/src/main/java/org/restcomm/connect/tts/voicerss/VoiceRSSSpeechSynthesizer.java#L95-L95

If no mapping can be done, a default language is used.

You think you could provide such mappings in the AWSPollySpeechSyntetizer ?

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 14, 2017

@otsakir My original idea was to reproduce the default AWS Polly keys :)

Yes of course, I'll change.

@otsakir

This comment has been minimized.

Contributor

otsakir commented Feb 14, 2017

great, thanks.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 15, 2017

@leftyb @otsakir Guys, I changed the language codes and it´s now working correctly.

@leftyb

This comment has been minimized.

Contributor

leftyb commented Feb 15, 2017

@rlimonta perfect.
Let me quick test and will update. Just as you can see again your branch is not updated with master so it can be merged. After I test, you will need to update one more time.

Thank you.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 15, 2017

@leftyb done.

@leftyb

This comment has been minimized.

Contributor

leftyb commented Feb 15, 2017

@rlimonta From a quick review I did, calling demo number from olympus +1235 It seems that language change is not working. How do you test?

I will test more and update.

Regards

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 15, 2017

@leftyb I have a testing environment on the cloud. Would you like to access it?

I'll send the access data in your email.

@leftyb

This comment has been minimized.

Contributor

leftyb commented Feb 15, 2017

@rlimonta No need for now let me test locally more first..
Thanks.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Feb 15, 2017

@leftyb Ok.

@leftyb

This comment has been minimized.

Contributor

leftyb commented Feb 15, 2017

@gvagenas can you please in the meantime review the contribution on code level so we can merge.
And later if any issues we can improve as we go.

Thanks

@otsakir otsakir self-requested a review Feb 17, 2017

@leftyb

This comment has been minimized.

Contributor

leftyb commented Mar 1, 2017

@rlimonta Please can you update your branch with the latest from master for a last time.
Master is updated really very often, so I need to ask to update one more time.
Just one comment, at your branch the TTS to be used by default is awspolly, but for the moment lets dont change the default value, so please use voicerss at the restcomm.conf file as the default system to be used.

Thank you.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Mar 1, 2017

@leftyb Ok, no problem! I'll make a new sync today.

@rlimonta

This comment has been minimized.

Collaborator

rlimonta commented Mar 2, 2017

@leftyb Done.

@leftyb leftyb merged commit e032ab8 into RestComm:master Mar 2, 2017

@leftyb leftyb removed the Peer Review label Mar 2, 2017

@leftyb

This comment has been minimized.

Contributor

leftyb commented Mar 2, 2017

@rlimonta Merge done. Thank you very much for your contribution.

@gvagenas gvagenas added this to the 8.1.0 milestone Apr 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment