New TTS engine: Microsoft Translator

tried it and both Google & MS works for me using ‘Say the weather’

Thanks

@JS007: I tried myself and saw that a bad session token provided lead to a “400 bad request” error like you got. So, for a reason I don’t understand, I think your session token is rejected by Microsoft while Microsoft just delivered it to you !

I am starting missing ideas to be honest :frowning:
I know that you registered your application to Microsoft using a secret you entered yourself. Maybe you could just try with the default secret generated by Microsoft for you. It is what I did.

What is very strange is that it works sometimes for you …

[quote=“fyford, post:61, topic:188264”]tried it and both Google & MS works for me using ‘Say the weather’

Thanks[/quote]

Good to know that it works for several users and not only myself.

@JS007: could you run “wget” in a SSH console and provide the result please in case it is different from mine:

BusyBox v1.17.3 (2012-01-09 12:40:42 PST) multi-call binary.

Usage: wget [-c|–continue] [-s|–spider] [-q|–quiet] [-O|–output-document FILE]
[–header ‘header: value’] [-Y|–proxy on/off] [-P DIR]
[–no-check-certificate] [-U|–user-agent AGENT] URL

Retrieve files via HTTP or FTP

Options:
-s Spider mode - only check file existence
-c Continue retrieval of aborted transfer
-q Quiet
-P Set directory prefix to DIR
-O FILE Save to FILE (‘-’ for stdout)
-U STR Use STR for User-Agent header
-Y Use proxy (‘on’ or ‘off’)

Maybe we should use the option -Y and set it to ‘off’ ?

They generated a client-secret with some weird characters which didn’t work. I had to type in my own.

created a new ID

this time i made name and id the same, all lowercase and checked “Enable subdomain access”

also made the pass all lowercase

works almost every time so far… does miss sometimes EDIT : (spoke too soon, it misses quite a few, much better then older ID though, but think gonna stick with Google in this plugin)

is weird, I changed all the options in old id to match, including password and it (the older id) still fails

the only difference now is in new one use redirect link “https://datamarket.azure.com” and old I used “https://microsoft.com”, but every time I try to change that it errors out on save

also the old ID had numbers and letters, new id is all lowercase leters

maybe the id was just created flaky or something for that first id

Tried MS again today after reloading the 4 files but it still fails.

–quiet
–header “Accept-Charset: utf-8;q=0.7,;q=0.3"
–header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,
/;q=0.8"
–header “Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=VeraTTS123&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&Audience=http%3a%2f%2fapi.microsofttranslator.com&ExpiresOn=1438824256&Issuer=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&HMACSHA256=vZlOXBauIOUw29kKz3CaXg9qPnw7PyrnNP51GuABbyI%3d”
–user-agent “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11”
http://api.microsofttranslator.com/V2/Http.svc/Speak?appId=&text=Test&language=en-US&format=audio%2Fmp3&options=MaxQuality” <0x743da520>
02 08/05/15 20:14:17.344 luup_log:150: Sonos: warning: Microsoft TTS: returnCocde=256 <0x743da520>
02 08/05/15 20:14:17.345 luup_log:150: Sonos: warning: Microsoft TTS: size=0 <0x743da520>
02 08/05/15 20:14:17.547 luup_log:150: Sonos: warning: Microsoft TTS: languages=caca-esdada-dkdede-deenen-auen-caen-gben-inen-useses-eses-mxfifi-fifrfr-cafr-fritit-itjaja-jpkoko-krnb-nonlnl-nlnoplpl-plptpt-brpt-ptruru-rusvsv-sezh-chszh-chtzh-cnzh-hkzh-tw <0x743da520>
02 08/05/15 20:14:17.548 luup_log:150: Sonos: warning: Microsoft TTS: failed! <0x743da520>
02 08/05/15 20:14:17.548 luup_log:150: Sonos: warning: Microsoft TTS: trying again with a new session token <0x743da520>
02 08/05/15 20:14:17.549 luup_log:150: Sonos: warning: Trying to get a new Microsoft session token <0x743da520>
02 08/05/15 20:14:18.041 luup_log:150: Sonos: warning: Getting a new Microsoft session token for 599 seconds <0x743da520>
02 08/05/15 20:14:18.042 luup_log:150: Sonos: warning: Microsoft TTS using token http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=VeraTTS123&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&Audience=http%3a%2f%2fapi.microsofttranslator.com&ExpiresOn=1438824257&Issuer=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&HMACSHA256=885FMmYYiehq3ngAyOVpMaA2PtmY5wXS7i9BT%2bqs%2f2A%3d <0x743da520>
02 08/05/15 20:14:18.192 luup_log:150: Sonos: warning: Microsoft TTS: command=rm /www/Say.150.mp3 ; wget --output-document /www/Say.150.mp3
–quiet
–header "Accept-Charset: utf-8;q=0.7,
;q=0.3”
–header “Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8”
–header “Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=VeraTTS123&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&Audience=http%3a%2f%2fapi.microsofttranslator.com&ExpiresOn=1438824257&Issuer=https%3a%2f%2fdatamarket.accesscontrol.windows.net%2f&HMACSHA256=885FMmYYiehq3ngAyOVpMaA2PtmY5wXS7i9BT%2bqs%2f2A%3d”
–user-agent “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11”
http://api.microsofttranslator.com/V2/Http.svc/Speak?appId=&text=Test&language=en-US&format=audio%2Fmp3&options=MaxQuality” <0x743da520>
02 08/05/15 20:14:18.193 luup_log:150: Sonos: warning: Microsoft TTS: returnCocde=256 <0x743da520>
02 08/05/15 20:14:18.194 luup_log:150: Sonos: warning: Microsoft TTS: size=0 <0x743da520>
02 08/05/15 20:14:18.375 luup_log:150: Sonos: warning: Microsoft TTS: languages=caca-esdada-dkdede-deenen-auen-caen-gben-inen-useses-eses-mxfifi-fifrfr-cafr-fritit-itjaja-jpkoko-krnb-nonlnl-nlnoplpl-plptpt-brpt-ptruru-rusvsv-sezh-chszh-chtzh-cnzh-hkzh-tw <0x743da520>
02 08/05/15 20:14:18.375 luup_log:150: Sonos: warning: Microsoft TTS: failed! <0x743da520>
01 08/05/15 20:14:18.398 LuaInterface::CallFunction_Job device 150 function SSonos1_Sonos1_Say_run took 7 seconds <0x743da520>
06

Anybody able to change the gender of the voice with the Microsoft TTS engine?

In 2014 it was a future feature but now they have this VoiceGender Enum (System.Speech.Synthesis) | Microsoft Learn which doesn’t state if this is available in the API or simply in Windows.

[quote=“lolodomo, post:63, topic:188264”][quote=“fyford, post:61, topic:188264”]tried it and both Google & MS works for me using ‘Say the weather’

Thanks[/quote]

Good to know that it works for several users and not only myself.[/quote]

due to the google side issues tried ms again, this time just works with no issues for me as well on veraedge 7.0.11\1.4

https://datamarket.azure.com/dataset/bing/microsofttranslator

I think this may be where I failed the first time, it should say “Active Subscription” for the 2,000,000, it did not before

@JS007: happy that it is now working for you too.

Thanks to all, I just converted from Google to Microsoft for TTS, and it works!

@lolodomo You mentioned that different languages in english use different voices. I had played around with that on Google (used fr for my french door ) and was a little surprised that they still worked with MS. That led me to look for voices on MS sites, and found some information at the link below.

[url=https://msdn.microsoft.com/en-us/library/dd145258.aspx]Microsoft Learn: Build skills that open doors in your career

It’s over my head, but wondered if it would be possible to add any of those parameters to the Sonos plugin? I don’t know if it’s doable, but thought I’d ask.

The API does not offer a choice of voice. You can only choose a language/country.

Oh well. I’m just happy it’s working! :slight_smile:

Thanks for posting this!

Took me awhile to figure it out being a noob but I got it to work with my Sonos :slight_smile:

I’m having a problem with Microsoft TTS not working.

Checked subscribed to the 200K or whatever the amount is.
Removed all symbols from secret code.
No spaces in ClientID.
Checked the sub directory thing and have https://microsoft.com as the website.

The funny thing is that Sonos won’t even stop playing a song to “attempt” the TTS. You would think if it was a problem with the Microsoft credentials it would play the song, pause… hear nothing… then resume the song again. It doesn’t even pause.

I have the 1.4 from the app store. It should be fully updated and I shouldn’t have to upload files manually, right?

Under Settings in the Sonos device you are trying to have speak, you may want to enable Debug logs (at the bottom) and check the output in the Vera log. It may indicate what the issue is. I remember setting Sonos up last month and tearing my hair out before I got it to work and checking those logs put me on the right path. Something stupid is all I remember.

[quote=“RHINESEL, post:75, topic:188264”]I’m having a problem with Microsoft TTS not working.

Checked subscribed to the 200K or whatever the amount is.
Removed all symbols from secret code.
No spaces in ClientID.
Checked the sub directory thing and have https://microsoft.com as the website.

The funny thing is that Sonos won’t even stop playing a song to “attempt” the TTS. You would think if it was a problem with the Microsoft credentials it would play the song, pause… hear nothing… then resume the song again. It doesn’t even pause.

I have the 1.4 from the app store. It should be fully updated and I shouldn’t have to upload files manually, right?[/quote]

on the settings tab for the plugin, did it discover your sonos? and is the ip the same as your sonos still, could of changed possibly if not use reserved or static IP’s

can you do things from the player tab?

[quote=“JS007, post:77, topic:188264”][quote=“RHINESEL, post:75, topic:188264”]I’m having a problem with Microsoft TTS not working.

Checked subscribed to the 200K or whatever the amount is.
Removed all symbols from secret code.
No spaces in ClientID.
Checked the sub directory thing and have https://microsoft.com as the website.

The funny thing is that Sonos won’t even stop playing a song to “attempt” the TTS. You would think if it was a problem with the Microsoft credentials it would play the song, pause… hear nothing… then resume the song again. It doesn’t even pause.

I have the 1.4 from the app store. It should be fully updated and I shouldn’t have to upload files manually, right?[/quote]

on the settings tab for the plugin, did it discover your sonos? and is the ip the same as your sonos still, could of changed possibly if not use reserved or static IP’s

can you do things from the player tab?[/quote]

Actually, the discovery patch is not installed. The ip’s should all be static, I did check them before when I was having TTS issues. I personally don’t know if Vera can control the Sonos or is just reading the state. I don’t think I’ve ever tried to control the Sonos via Vera since moving to UI7 but Google Translate did work before in UI7 so I’m not sure.

With the holidays it’ll be a few days before I can troubleshoot more.

People keep saying the settings tab of the plugin… my plugin doesn’t have a settings tab. Do you mean the tab of the device? Did the plugin not carry over correctly UI5 to UI7?

yes, the device created by the plugin is what I meant

I did not have installed in UI5, only UI7, so not sure