Author Topic: New TTS engine: Microsoft Translator  (Read 59115 times)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
New TTS engine: Microsoft Translator
« on: August 01, 2015, 05:40:00 am »
Microsoft Translator is now available as a TTS engine for the Sonos plugin : http://code.mios.com/trac/mios_sonos-wireless-music-systems/browser/trunk
You will have to upload 4 files: I_Sonos1.xml + J_Sonos1.js + L_SonosTTS.lua + S_Sonos1.xml. Take them from the ZIP file.

To setup the engine, you will have first to do step 1 and step 2 described here: https://www.microsoft.com/translator/getstarted.aspx
You have more details here: https://msdn.microsoft.com/en-us/library/mt146806.aspx (you have to do step 1 to 4)
As a result, you will get your credentials.
Then, you just have to set your client id and client secret in the TTS tab of the plugin.

The quality of the speech is very good, even better than Google for French. The speech is just a little too fast in my opinion. Microsoft server seems to be very fast to provide the MP3 file.

In your scenes, you have to use "MICROSOFT" to identify this engine.
« Last Edit: December 21, 2015, 02:37:47 am by lolodomo »

Offline wezley69

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +6/-6
Re: New TTS engine: Microsoft Translator
« Reply #1 on: August 01, 2015, 10:59:19 am »
What information needs to be provided in step 2 on MS Translator?  URL etc?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #2 on: August 01, 2015, 11:23:21 am »
I just imrpoved error checking. Please update, my previous version lead to TTS not working after a first failure (for example due to bad credentials).
A warning is now logged when the audio file cannot be retrieved and Sonos audio is not cut at all in this case.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #3 on: August 01, 2015, 11:30:17 am »
What information needs to be provided in step 2 on MS Translator?  URL etc?

I should have provided this other link: https://msdn.microsoft.com/en-us/library/mt146806.aspx
You have to do step 1 to 4.

Quote
    Client ID: Give your application a unique name for calling the API. Do not use spaces in your Client ID.
    Name: The name of the application will be displayed to the user when asking the user's permission to access their account (spaces are allowed).
    Client Secret: This is the password your application uses to call the API. You may provide your own or use the provided password.
    Redirect URI: Complete this with any valid URL that uses https, for example https://microsoft.com. This field is not used by the Microsoft Translator API.
    Enable Subdomain Access: Translator does not use subdomain access so you can leave this box unchecked.
    Description: Optional description for the application, visible only to you.

« Last Edit: August 01, 2015, 12:02:32 pm by lolodomo »

Offline tomgru

  • Hero Member
  • *****
  • Posts: 1403
  • Karma: +18/-6
Re: New TTS engine: Microsoft Translator
« Reply #4 on: August 01, 2015, 12:35:56 pm »
doesn't seem to be working... at least trying to test from the device instance.

first question... do you have to update the ID and Secret in each sonos device (e.g. each speaker or connect)?  This looks to be the case, as setting at one doesn't propagate to the others.

Second... doesn't look like you have to perform a reload after, but i tried that as well and still doesn't work.

Third, does it matter if the Client ID has caps in it (but no spaces)?

I also notice that when you select Microsoft, the google URL remains.  I tried deleting it, but it still comes back, along with the Microsoft settings.
« Last Edit: August 01, 2015, 12:38:23 pm by tomgru »

Offline tomgru

  • Hero Member
  • *****
  • Posts: 1403
  • Karma: +18/-6
Re: New TTS engine: Microsoft Translator
« Reply #5 on: August 01, 2015, 12:53:47 pm »
In your scenes, you have to use "MICROSOFT" to identify this engine.

One more :-)

I see where to do this in the advanced tab...but where would I put this if my scene uses LUA to handle the TTS?

thanks again for getting on this so quick.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #6 on: August 01, 2015, 01:01:35 pm »
In your scenes, you have to use "MICROSOFT" to identify this engine.

One more :-)

I see where to do this in the advanced tab...but where would I put this if my scene uses LUA to handle the TTS?

thanks again for getting on this so quick.

Take a look to the wiki page, you have an example on how using OSX TTS server. That is the parameter "Engine".

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #7 on: August 01, 2015, 01:10:01 pm »
doesn't seem to be working... at least trying to test from the device instance.

You probably miss something because I am sure it is working and even very well ;D

Quote
first question... do you have to update the ID and Secret in each sonos device (e.g. each speaker or connect)?  This looks to be the case, as setting at one doesn't propagate to the others.

Yes, on each device you wish to request TTS.

Quote
Second... doesn't look like you have to perform a reload after, but i tried that as well and still doesn't work.

It could be required after the first time you reload your Vera with the new version.
I believe it is even not required but I am not 100% sure.
Then you can change your TTS settings without reloading if you use the TTS tab and the Set button at the bottom of this tab.

Quote
Third, does it matter if the Client ID has caps in it (but no spaces)?

Yes, try for example TTSvera.

Quote
I also notice that when you select Microsoft, the google URL remains.  I tried deleting it, but it still comes back, along with the Microsoft settings.

The screen has 2 zones, the top part with the Say button to run TTS and the bottom part with the Set button to setup the TTS parameters.
So of course your Google URL will remain as it is the parameter for the Google engine.
First set your TTS settings and finish by pushing the Set button; then use the Say button to run TTS with the new settings.



Please check your Vera logs and tell me what error message you have (using my last version that logs errors).
If it does not work, that is certainly because you don't set properly your credentials.
« Last Edit: August 01, 2015, 01:13:10 pm by lolodomo »

Offline tomgru

  • Hero Member
  • *****
  • Posts: 1403
  • Karma: +18/-6
Re: New TTS engine: Microsoft Translator
« Reply #8 on: August 01, 2015, 01:28:27 pm »
ok... tried changing the Name and ID just to see... same issue.  Says active. Maybe I missed a step on that side.... logs look good:

08      08/01/15 10:27:12.146   JobHandler_LuaUPnP::HandleActionRequest device: 145 service: urn:micasaverde-com:serviceId:Sonos1 action: Say <0x32e26680>
08      08/01/15 10:27:12.147   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=145 <0x32e26680>
08      08/01/15 10:27:12.147   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Sonos1 <0x32e26680>
08      08/01/15 10:27:12.147   JobHandler_LuaUPnP::HandleActionRequest argument action=Say <0x32e26680>
08      08/01/15 10:27:12.147   JobHandler_LuaUPnP::HandleActionRequest argument Text=this is a second test <0x32e26680>
08      08/01/15 10:27:12.148   JobHandler_LuaUPnP::HandleActionRequest argument Language=en <0x32e26680>
08      08/01/15 10:27:12.148   JobHandler_LuaUPnP::HandleActionRequest argument Engine=MICROSOFT <0x32e26680>
08      08/01/15 10:27:12.148   JobHandler_LuaUPnP::HandleActionRequest argument Volume=56 <0x32e26680>
08      08/01/15 10:27:12.158   JobHandler_LuaUPnP::HandleActionRequest argument SameVolumeForAll=false

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #9 on: August 01, 2015, 02:13:09 pm »
To be honest, I have not tested through a lua call but only through the plugin UI.

Is it working for you from within the UI (TTS tab of the plugin) ?

Did you upload the 4 updated files, reload and clear your WEB browser cache ?

Please enable the debug log to see if the new function is called.
« Last Edit: August 01, 2015, 02:26:19 pm by lolodomo »

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #10 on: August 01, 2015, 02:22:36 pm »
I just tested to create a new scene with a Say action, just filling text, language and engine with MICROSOFT. It works.
« Last Edit: August 01, 2015, 02:25:46 pm by lolodomo »

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: New TTS engine: Microsoft Translator
« Reply #11 on: August 01, 2015, 02:26:31 pm »
@lolodomo Would it be possibly to please update the DLNA plug-in for Microsoft tts as well? Thanks !

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #12 on: August 01, 2015, 02:30:33 pm »
@lolodomo Would it be possibly to please update the DLNA plug-in for Microsoft tts as well? Thanks !

Yes, I will do when the change is 100% finished for the Sonos plugin.

Offline JS007

  • Sr. Member
  • ****
  • Posts: 319
  • Karma: +1/-3
Re: New TTS engine: Microsoft Translator
« Reply #13 on: August 01, 2015, 03:23:57 pm »
thank you, that worked for me

is there a way to pick other voices?

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: New TTS engine: Microsoft Translator
« Reply #14 on: August 01, 2015, 03:27:04 pm »
is there a way to pick other voices?

Apparently no; only one voice per language.