New TTS engine: Microsoft Translator

Microsoft Translator is now available as a TTS engine for the Sonos plugin : trunk – Sonos Wireless HiFi Music Systems
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: Azure Cognitive Services Translator documentation - quickstarts, tutorials, API reference - Azure Cognitive Services | Microsoft Learn (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.

What information needs to be provided in step 2 on MS Translator? URL etc?

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.

I should have provided this other link: Azure Cognitive Services Translator documentation - quickstarts, tutorials, API reference - Azure Cognitive Services | Microsoft Learn
You have to do step 1 to 4.

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.

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.

One more :slight_smile:

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.

One more :slight_smile:

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.[/quote]

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

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

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.

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.

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

Yes, try for example TTSvera.

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.

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

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.

I just tested to create a new scene with a Say action, just filling text, language and engine with MICROSOFT. It works.

@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.

thank you, that worked for me

is there a way to pick other voices?

Apparently no; only one voice per language.

Apparently no; only one voice per language.[/quote]

oh that works, I thought those meant for alerts in other langauges, but they have different voices, did not ever try that before, thanks, will go with French :slight_smile:

Tel me what you think for French, that is better with Google or Microsoft ?

Tel me what you think for French, that is better with Google or Microsoft ?[/quote]

never tried it with google, always picked english as I did not know they changed the voice

am getting the errors again, not sure if ms down or did not like me testing with same message over and over and they are giving me a time out in case I am a bot :slight_smile:

“Saturday, August 1, 2015 - 2:44 PM Central Time
Unable to play ‘Say.144.mp3’ - the track is not encoded correctly.”

reboot did not help, I will give it like 30 min and try again

On my side, I did a lot of requests today, probably more than I will never do in the future, and it always worked well.

You are on UI5 or UI7, Vera3/VeraLite or Vera Edge ? Maybe the HTTP server of our Vera is a lttile different.
If you use the last version of the code, your error means that at least a non empty MP3 file was retrieved from Microsoft server and saved inside Vera memory. Then that is only the playing by Sonos of a MP3 file distributed by the Vera HTTP server that apparently fails in your case.

[quote=“lolodomo, post:19, topic:188264”]On my side, I did a lot of requests today, probably more than I will never do in the future, and it always worked well.

You are on UI5 or UI7, Vera3/VeraLite or Vera Edge ? Maybe the HTTP server of our Vera is a lttile different.
If you use the last version of the code, your error means that at least a non empty MP3 file was retrieved from Microsoft server and saved inside Vera memory. Then that is only the playing by Sonos of a MP3 file distributed by the Vera HTTP server that apparently fails in your case.[/quote]

I am ui7 on the edge, just tried again and still not working, weird it worked at first, then as changing voices(languages) it stopped and gave that error

and trying again it gives that error every time no matter what I pick now

it makes it to sonos as I see the error in the logs on sonos

Saturday, August 1, 2015 - 9:33 PM Central Time
Unable to play ‘Say.144.mp3’ - the track is not encoded correctly.

gonna set my vera to default, load a backup from when did upgrade and try again with reloading plugin