Microsoft TTS endSayAlert

lolodomo

I’m using Microsoft TTS and had a problem when playing a track after a voice alert. Shortly into the track it would stop and I could see that it was due to a endSayAlert on. On inspection of the code I put it down to this line in L_SonosTTS.lua:

duration = math.ceil(size/3000) + 1

Your comment in the code suggests that you’re expecting a 24kbps file, but the one delivered to my system (I suspect this will be the same for everyone) is 128kbps. This results in the duration being calculated being much longer than the mp3 file which is created for the alert. I’ve replaced the line with the following:

duration = math.ceil(((size / 1024) * 8) / 128) + 1

This seems to work well now and endSayAlert is called within a second of the alert ending. Previously a 10 second alert was being calculated at around 30 seconds.

Thanks for all your hard work, the plug-in is great!

Yes, I already fixed this issue 1 or 2 weeks ago. Take a look to the topic relative to the Microsoft Translator engine.