Text to Speech

No, there isn’t, I’ll update the plugin on the weekend.

Sorry Lerg.
Another crash during testing seems to suggest something to do with text to speech.
This time it was on my test device in usb debug mode, does this mean anything to you? Could it be the same bug?..
 

Apr 05 11:50:20.531 GT-I9300: FATAL EXCEPTION: Binder\_2 Apr 05 11:50:20.531 GT-I9300: java.lang.Error: error throwing Lua exception Apr 05 11:50:20.532 GT-I9300: at com.naef.jnlua.LuaState.lua\_pcall(Native Method) Apr 05 11:50:20.532 GT-I9300: at com.naef.jnlua.LuaState.call(Unknown Source) Apr 05 11:50:20.532 GT-I9300: at plugin.texttospeech.LuaLoader$2.onStart(LuaLoader.java:149) Apr 05 11:50:20.532 GT-I9300: at android.speech.tts.TextToSpeech$Connection$1.onStart(TextToSpeech.java:1459) Apr 05 11:50:20.532 GT-I9300: at android.speech.tts.ITextToSpeechCallback$Stub.onTransact(ITextToSpeechCallback.java:55) Apr 05 11:50:20.533 GT-I9300: at android.os.Binder.execTransact(Binder.java:388) Apr 05 11:50:20.533 GT-I9300: at dalvik.system.NativeStart.run(Native Method)

Device info:

GT-I9300: Platform: GT-I9300 / ARM Neon / 4.3 / Mali-400 MP / OpenGL ES 2.0 / 2016.2856 / English | GB | en\_GB | en

@juliusbangert, no, that’s a different one, I think I know how to fix it.

Thanks so much Lerg.
I guess now I’m in alpha testing phase I am seeing more of this kind of thing than before. If there’s anything I can do to help in terms of providing more crash reports or console logs let me know.
Cheers.

You’ve done great job reporting these, we just need to wait for the weekend and then we’ll see if crashing stops.

This one is slightly different to the one above :

Apr 06 01:59:11.976 GT-I9300: FATAL EXCEPTION: Binder\_1 Apr 06 01:59:11.977 GT-I9300: java.lang.Error: error throwing Lua exception Apr 06 01:59:11.977 GT-I9300: at com.naef.jnlua.LuaState.lua\_pushstring(Native Method) Apr 06 01:59:11.977 GT-I9300: at com.naef.jnlua.LuaState.pushString(Unknown Source) Apr 06 01:59:11.978 GT-I9300: at plugin.texttospeech.LuaLoader$2.onDone(LuaLoader.java:131) Apr 06 01:59:11.978 GT-I9300: at android.speech.tts.TextToSpeech$Connection$1.onDone(TextToSpeech.java:1443) Apr 06 01:59:11.978 GT-I9300: at android.speech.tts.ITextToSpeechCallback$Stub.onTransact(ITextToSpeechCallback.java:63) Apr 06 01:59:11.978 GT-I9300: at android.os.Binder.execTransact(Binder.java:388) Apr 06 01:59:11.978 GT-I9300: at dalvik.system.NativeStart.run(Native Method)

Updated the plugin. Those bugs now should disappear.

Excellent news Lerg. Thanks again. 

Hi Lerg. Do you know of any way to determine what the voices on android are?
So I get a table back from** texttospeech.getLanguagesAndVoices() **which contains entries something like this…

local voices = { ['en-GB-fis-network'] = 'en-GB', ['en-gb-x-fis'] = 'en-GB', ['en-US-sfg-network'] = 'en-US', ['en-GB-locale'] = 'en-GB', ['en-AU-afi-network'] = 'en-AU', ['en-GB-rjs-network'] = 'en-GB', ['en-us-x-sfg'] = 'en-US', ['en-IN-ahp-network'] = 'en-IN', ['en-US-locale'] = 'en-US', ['es-us-x-sfb|es-US'] = 'es-US', ['en-IN-locale'] = 'en-IN', ['en-in-x-cxx'] = 'en-IN', ['es-US-locale'] = 'es-US', ['en-IN-cxx-network'] = 'en-IN', }

Is there any way through the Java API that your plugin uses, to look up a display name for these voices? Like British English Female or American English Male ?
I googled to see if I could find any reference to what these codes mean but can’t seem to find anything.

Such list is engine specific. There must be somebody who made such list by hand, but I couldn’t find it.
For SVOX, however, they provide such list.
https://svoxmobilevoices.wordpress.com/developers/
https://svoxmobilevoices.files.wordpress.com/2011/10/voices-and-referral-urls.xlsx

Cheers Lerg.

Yea, the voice codes I’m getting on my android device tests do not look like any of those listed in the spreadsheet. The only engine returned in the texttospeech.init() callback is :

local engines = { ["Google Text-to-speech engine"] = "com.google.android.tts" }

So there’s programatical retrieval method for these voice names?

SVOX is another TTS engine, you can use it if it’s available on a device by calling setEngine(). It can be installed from Google Play Market.

For the standard Google TTS engine, I couldn’t find a list with proper description for each voice entry.

Hi Lerg.
Did something change with the plugin recently? Since daily build 2865 to 2866?
It’s just crashing on android and it seems to be something with texttospeech. It may well be something I’ve changed but I can’t seem to trace it, and I’m not sure what the error report means. I’ve attached it here.

It can’t really be to do with the daily build version, I tried going back to 2865 and it still happens. It’s specifically happening on Android builds when calling texttospeech.getLanguagesAndVoices(). Here’s a break down of where it’s happening, I call the following code :

local function texttospeechInitOnComplete( event ) print( 'texttospeechInitOnComplete' ) if not event.isError then print( 'not event.isError' ) local languagesAndVoices = texttospeech.getLanguagesAndVoices() print( 'languagesAndVoices' ) end end print( 'call texttospeech.init' ) texttospeech.init( texttospeechInitOnComplete )

And the output on Android loos like this:

call texttospeech.init texttospeechInitOnComplete not event.isError FATAL EXCEPTION: GLThread 7772

Whereas on iOS it looks like this:
 

call texttospeech.init texttospeechInitOnComplete not event.isError table: 0x1642e9c0

Any ideas?

juliusbangert, hi.

Huh… It looks like there is a bug in Android or the speech engine you are using.
http://stackoverflow.com/questions/26730082/illegalargumentexception-invalid-int-os-with-samsung-tts

What engine do you use? Samsung TTS?

The workaround would be in not calling getLanguagesAndVoices() for the samsung TTS. You can check if it’s selected and switch to Google TTS instead.
 

Please copy here the output of event.engines and event.defaultEngine  inside the init callback.

Thanks Lerg. I’ll check tomorrow, the device I tested that on was a Samsung tablet, but I think it’s more broad than that because another test device I use is a Motorola phone. But I’ll test tomorrow and report back with the event.engines and event.defaultEngine outputs.

Added workaround for Samsung TTS failing on getLanguagesAndVoices. Now the code is wrapped in try catch and will return nil if an error occurs.

Thanks Lerg. Yea I was just running the tests for you and noticed it didn’t cause a crash. But then no languages are returned either. I guess that’s just what happens on Samsung, should I just call texttospeech.setEngine(‘com.google.android.tts’) if it’s available? Is it safe to assume that this the reverse domain identifier com.google.android.tts is here to stay and will probably be available on most android devices?. Below is the various returns from the following code :

local function texttospeechInitOnComplete( event ) print( '\_\_ Called texttospeechInitOnComplete \_\_' ) if not event.isError then print( 'isError : '.. tostring( isError ) ) print( 'engines : ' ) table.print( event.engines ) print( 'defaultEngine : ' .. tostring( event.defaultEngine ) ) print( 'languagesAndVoices : ' ) table.print( texttospeech.getLanguagesAndVoices() ) end end print( '\_\_ Called texttospeech.init \_\_' ) texttospeech.init( texttospeechInitOnComplete )

On Samsung Tab :

\_\_ Called texttospeech.init \_\_ \_\_ Called texttospeechInitOnComplete \_\_ isError : false engines : \_\_unnamed\_\_ = { ["Google Text-to-speech engine"] = "com.google.android.tts", ["Samsung text-to-speech engine"] = "com.samsung.SMT", }, defaultEngine : com.samsung.SMT languagesAndVoices : nil

On HTC Phone :

\_\_ Called texttospeech.init \_\_ \_\_ Called texttospeechInitOnComplete \_\_ isError : false engines : \_\_unnamed\_\_ = { ["Google Text-to-speech engine"] = "com.google.android.tts", ["Samsung text-to-speech engine"] = "com.samsung.SMT", }, defaultEngine : com.google.android.tts languagesAndVoices : ... A large table output ... 

Yes, you can set engine to google, almost all phones have it, but check in the init listener to be sure.