Text to Speech

I’m using the hottest CoronaSDK I think (2018.3218) and I’m using TextToSpeech according to the new docs. Everything seems to work, but the call to enableDebug().

As for the spelling - that’s why I added the example, so that you could se for yourself.

BTW, I get the exact same error when trying the plugin sample:

https://github.com/Lerg/plugins-sample-texttospeech

There must be something fishy somewhere…

Hi Lerg,

With the whole commotion with GDPR, can I know what data is being collected by your plugin and do you have an updated privacy policy I can review?

Ben

gamebit.labs, none of my plugins collect any data, so GDPR does not apply.

Ha! So you ARE still alive!

Thanks for the clarification.

Ben

Hi Lerg,

How have you been?

I’m writing to discuss an issue i am facing with the plugin and iOS 12. I have noticed recently that if my locale is en-GB, I am unable to manually set English voices like “samantha” to playback tts. I am only able to use “daniel” which is the default preinstalled voice for en-GB. I remember this was possible in iOS 11.

Similarly, I am unable to use “damayanti” which is the default voice for id-ID to playback Malay text string when my locale is set to ms-MY.

Ben

BTW, can we access Siri voices in iOS 12?

Ben

Hi Ben,

I am currently in a little trip and can’t test this yet. However Apple doesn’t let developers use the latest Siri voices in tts. You only have available what’s reported by getLanguagesAndVoices(). Are “daniel” and “damayanti” missing in that call?

Hi Lerg,

We’re rechecking our code to determine the issue. "daniel and “damayanti” works only if you set your locale to en-GB and id-ID respectively. Seems unlikely its an iOS 12 issue now. However, i appreciate it if you can check on this when you’re back.

Ben.

Hi Lerg,

We solved this.

Ben

https://www.theverge.com/2019/6/3/18650906/siri-new-voice-ios-13-iphone-homepod-neutral-text-to-speech-technology-natural-wwdc-2019

Hi Lerg,

New Siri is coming to iOS 13. Any news if current versions of Siri will be accessible to developers?

Ben

Hi Lerg,

06-08 13:06:35.471 26071 27886 I Corona  :     “es-es-x-ana-local”:“es-ES”,
06-08 13:06:35.471 26071 27886 I Corona  :     “id-id-x-dfz-network”:"

When executing getLanguagesAndVoices, i notice the last line is always truncated. Happens on both android and ios. From the example above, it’s missing the locale. Not sure if this is the last line in the query.

Ben

Hi Ben, it’s too soon to tell about voices, we should wait for the final release.
The truncation happens in the print statement, not in the actual data. Corona started to truncate long print statements.
I should replace json.prettify() with a for loop in the sample someday…

Hi Lerg,

I just install iPadOS 13 Beta on my iPad Air 2 today. When I launched my app, there was no TTS playback at all.

I ran getLanguagesAndVoices and this is the result from Console:

Languages and voices: { "languages":[], "name":"getLanguagesAndVoices", "voices":{ "default":"" }, "isError":false }

Then, I opened the Settings app > Accessibility > VoiceOver > Speech > Voice, and I saw the window refreshed with text “Loading Voices…”

I think there is a bug here. Nothing happens after mins. If you reload the Voice window, you’ll now see a list of English voices. Apple made some changes here. If you go back, you’ll see a setting that is turned on “Detect Languages”. Voices are now displayed based on your current device language.

I relaunched my app and TTS playback resumed to work. At this point, if I run getLanguagesAndVoices, i can see the list of voices in iOS normally.

So, coming back to my initial point, why wasn’t there any TTS playback when I ran my app immediately after iOS upgrade? Did I trigger a process when I navigated to the voice list window? What happens if users don’t do this, will iOS do this in the background?

Ben

Hi Ben,

When iPad OS comes out I will make sure the plugin works as expected, before that it’s most likely a bug in the beta.

Hi Lerg,

Does TTS plugin work in Android 4.3 to 4.4.4? I can’t seem to be able to get it to work.

Ben

09-05 02:22:25.007  2020  2244 V Corona  : > Class.forName: plugin.texttospeech.LuaLoader
09-05 02:22:25.007  2020  2244 I dalvikvm: Could not find method android.speech.tts.TextToSpeech.getAvailableLanguages, referenced from method plugin.texttospeech.LuaLoader.getLanguagesAndVoices
09-05 02:22:25.007  2020  2244 W dalvikvm: VFY: unable to resolve virtual method 1045: Landroid/speech/tts/TextToSpeech;.getAvailableLanguages ()Ljava/util/Set;
09-05 02:22:25.007  2020  2244 D dalvikvm: VFY: replacing opcode 0x6e at 0x001d
09-05 02:22:25.017  2020  2244 E dalvikvm: Could not find class ‘android.speech.tts.Voice’, referenced from method plugin.texttospeech.LuaLoader.getLanguagesAndVoices
09-05 02:22:25.017  2020  2244 W dalvikvm: VFY: unable to resolve check-cast 275 (Landroid/speech/tts/Voice;) in Lplugin/texttospeech/LuaLoader;
09-05 02:22:25.017  2020  2244 D dalvikvm: VFY: replacing opcode 0x1f at 0x0086
09-05 02:22:25.017  2020  2244 I dalvikvm: Could not find method android.speech.tts.TextToSpeech.getVoices, referenced from method plugin.texttospeech.LuaLoader.speak
09-05 02:22:25.017  2020  2244 W dalvikvm: VFY: unable to resolve virtual method 1049: Landroid/speech/tts/TextToSpeech;.getVoices ()Ljava/util/Set;
09-05 02:22:25.017  2020  2244 D dalvikvm: VFY: replacing opcode 0x6e at 0x0198
09-05 02:22:25.017  2020  2244 E dalvikvm: Could not find class ‘android.speech.tts.Voice’, referenced from method plugin.texttospeech.LuaLoader.speak
09-05 02:22:25.017  2020  2244 W dalvikvm: VFY: unable to resolve check-cast 275 (Landroid/speech/tts/Voice;) in Lplugin/texttospeech/LuaLoader;
09-05 02:22:25.017  2020  2244 D dalvikvm: VFY: replacing opcode 0x1f at 0x01b5
09-05 02:22:25.017  2020  2244 I dalvikvm: Could not find method android.speech.tts.TextToSpeech.synthesizeToFile, referenced from method plugin.texttospeech.LuaLoader.speak
09-05 02:22:25.017  2020  2244 W dalvikvm: VFY: unable to resolve virtual method 1060: Landroid/speech/tts/TextToSpeech;.synthesizeToFile (Ljava/lang/CharSequence;Landroid/os/Bundle;Ljava/io/File;Ljava/lang/String;)I
09-05 02:22:25.017  2020  2244 D dalvikvm: VFY: replacing opcode 0x6e at 0x01e9
09-05 02:22:25.017  2020  2244 I dalvikvm: Could not find method android.speech.tts.TextToSpeech.speak, referenced from method plugin.texttospeech.LuaLoader.speak
09-05 02:22:25.017  2020  2244 W dalvikvm: VFY: unable to resolve virtual method 1057: Landroid/speech/tts/TextToSpeech;.speak (Ljava/lang/CharSequence;ILandroid/os/Bundle;Ljava/lang/String;)I
09-05 02:22:25.017  2020  2244 D dalvikvm: VFY: replacing opcode 0x6e at 0x01f2

gamebit.labs, some features require android 5.0, seems that I forgot to specify which ones.

Is this plugin still supported? I can’t get it to work when trying to build to iOS.

Hi @Lerg, can you please look?
I’ve got your sample, filled in the email and token, and here goes “mach-o, but wrong architecture”.
Is it all about my M1 MacBook, or what?

Error loading module 'plugin_texttospeech' from file '/Users/max/Library/Application Support/Corona/Simulator/Plugins/plugin_texttospeech.dylib':

dlopen(/Users/max/Library/Application Support/Corona/Simulator/Plugins/plugin_texttospeech.dylib, 2): no suitable image found. Did find:

/Users/max/Library/Application Support/Corona/Simulator/Plugins/plugin_texttospeech.dylib: mach-o, but wrong architecture

/Users/max/Library/Application Support/Corona/Simulator/Plugins/plugin_texttospeech.dylib: mach-o, but wrong architecture

File: error loading module 'plugin_texttospeech' from file '/Users/max/Library/Application Support/Corona/Simulator/Plugins/plugin_texttospeech.dylib'

Native plugins has to be rebuilt for m1. To do that one just needs to rebuild the plugin with Xcode 12+. I did it for all first party plugins except openssl already.

1 Like