Text to Speech

runewinse , 

Please teach me?  :huh:  :huh:  :huh:

Sorry? Teach you what?

i can not open project 

00:46:26.657  WARNING: issue found in C:\Users\Administrator\Downloads\plugins-sample-texttospeech-a8d4d43737421532904dc3f627a66fc3f619c7e6\plugins-sample-texttospeech-master\build.settings: 

00:46:26.657  WARNING: deprecated key: settings.iphone.plist.CFBundleIconFile (string)

oh! I forgot to show code error
 

main.lua:15: attempt to call field ‘enableDebug’ (a nil value)

I forgot to show codeI forgot to show code

I forgot to show code

I forgot to show code

I forgot to show code
I forgot to show code
I forgot to show codeI forgot to show code

I forgot to show code

I forgot to show code

I forgot to show code

I forgot to show code
I forgot to show code

I forgot to show code

If this is Lergs demo code you’re talking about, I think your problem might be that you’re using an old plugin version. For me it helped to do a Corona Simulator log out (deuathorize) / log in.

Lerg, did this list make you any wiser? I notice that “no-NO” not only is missing from Voices, but also from Languages. Not sure if this is related to the bug I’m experiencing though.

Yes, that could be the issue. Actual language code for the Norwegian language is “nb-NO”. And you can find a voice for it as well.

Also, the list of voices is not full, it’s truncated due to long output, have to print voices one item at a time to see them all.

So try using “nb-NO”.

That’s it! For some reason “no-NO” worked for everything else than switching languages on Android!

Thanks a lot, Sergey!  :slight_smile:

Yay! One mystery less.

Hi Sergey,

First off, love this plugin, thank you so much for writing it!

I’ve just switched to your new version which seems to work fine in the simulator (Mac OS 10.12.1) but I’m getting “attempt to index a string value” crashes on device in the following situations:

  1. specifying any kind of callback for texttospeech.init,  even an empty function.
  2. calling texttospeech.getLanguagesAndVoices

Device is an iPhone 6 (iOS 10.1.1) and the app was built with Corona 2016.2983

Many thanks,

Andrzej

Andrzej Futuretro, hi!

Can you try the sample app, does it work?

init() now accepts a table of params, be sure to use it this way.

Hi @Lerg. I have the same problem in applying the text-to-speech plugin.

It works on Corona 2972 (as I know it works up to 2978)  but not on Corona 2980.

The code can be as simple as just 2 lines in “main.lua”, with all other files same as your sample at Github:

local texttospeech = require('plugin.texttospeech') texttospeech.init(function() end)

It is shown in Simulator Console as:

WARNING: The ‘plugin.texttospeech’ library is not available on this platform.

which is expected.

When I built for iOS  with a development provisional profile, installed by xCode and run with my iPhone. There was a native pop up at program startup showing that:

Runtime error - attempt to index a function value

and the xCode console showed:

stack traceback:

[C]: in function ‘init’

/Users/lwkApple/OneDrive/Projects/Sample_TextToSpeech/main.lua:14: in main chunk

when I changed the second line of the above code as:

texttospeech.init({listener = function() end)}

then the Runtime error was shown as:

Runtime error

/Users/lwkApple/OneDrive/Projects/Sample_TextToSpeech/main.lua:14: [Lua::DispatchEvent()] ERROR: Attempt to dispatch malformed event. The event must have a ‘name’ string property.

I have no idea of what those mean. Could it be a bug of Corona? There will be no problem at all if I use Corona Build 2972.

I’ve tried to de-authorize and re-login but it didn’t help…

Here are my platform:

Xcode 8.0

Mac version 10.11.6

Corona 2980 (didn’t work), Corona 2972(no problem at all)

iPhone SE running on 10.0.2

wilsonwansun, hm, just to be sure, have you tried downloading and building the sample app? It’s crucial to know that, because that would eliminate any syntax typos or other similar errors.

Hi Sergey,

Just to say I’m having the same results as wilsonwansun if I pass a table of params into init():

ERROR: Attempt to dispatch malformed event. The event must have a ‘name’ string property.

P.S. I just built the sample app from your GitHub and got the same results.

Very strange. Can you try latest Corona 2984?
Also does it work in the simulator and on android?

Corona 2984 yields the same results: works in the simulator no problems at all but not on iOS. If I don’t pass anything at all to init then there is no issue and the voice synthesis seems to work as intended. getLanguagesAndVoices results in the same crash.

Do you have any iOS 9 devices around? Maybe it’s iOS 10 issue somehow, that’s the only thing I see you two have in common and I don’t.
Also what would happen if you write
texttospeech.init({engine = ‘string’})
 

No iOS 9 devices here I’m afraid :frowning:

Doesn’t crash with texttospeech.init({engine = ‘string’})

Noticed one more thing, if I specify an onComplete callback for texttospeech.speak, as soon as the speech has ended the app drops out entirely with no assert!

Edit: which suggests all the issues might have something to do with callbacks?

This is the message of my Simulator console (build 2980) when I tried to run your sample code. It seems that the plugin was not properly loaded, right?

main.lua:15: in main chunk Nov 03 09:32:14.239  Nov 03 09:33:13.564 Copyright (C) 2009-2016  C o r o n a   L a b s   I n c .                     Version: 3.0.0                     Build: 2016.2980 Nov 03 09:33:58.946 WARNING: issue found in build.settings:  Nov 03 09:33:58.946 WARNING: deprecated key: settings.iphone.plist.CFBundleIconFile (string) Nov 03 09:33:58.946 Copyright (C) 2009-2016  C o r o n a   L a b s   I n c .                     Version: 3.0.0                     Build: 2016.2980 Nov 03 09:33:58.962 Loading project from:   ~/Desktop/plugins-sample-texttospeech-master Nov 03 09:33:58.962 Project sandbox folder: ~/Library/Application Support/Corona Simulator/plugins-sample-texttospeech-master-5DB66B703803B2D118661E8D1EAD7E0B Nov 03 09:33:58.996 Platform: iPhone / x86\_64 / 10.11.6 / Intel HD Graphics 3000 OpenGL Engine / 2.1 INTEL-10.0.51 / 2016.2980 / en | HK | en\_HK | en Nov 03 09:33:59.096 ERROR: Runtime error                     main.lua:15: attempt to call field 'enableDebug' (a nil value)                     stack traceback:                     main.lua:15: in main chunk Nov 03 09:33:59.097

This result was the same when I used Corona build 2972 (i.e. nil enableDebug).

I guess the plugin that was loaded from Corona server is not your latest version.