vilicvane / cordova-plugin-tts

Cordova Text-to-Speech Plugin (Maintainer WANTED!)
177 stars 137 forks source link

crash galaxy note4 - android 6.0 #37

Open ozexpert opened 7 years ago

ozexpert commented 7 years ago

error on galaxy note4

java.lang.IllegalArgumentException: Invalid int: "OS"
    at android.os.Parcel.readException(Parcel.java:1624)
    at android.os.Parcel.readException(Parcel.java:1573)
    at android.speech.tts.ITextToSpeechService$Stub$Proxy.getVoices(ITextToSpeechService.java:796)
    at android.speech.tts.TextToSpeech.getVoice(TextToSpeech.java:1769)
    at android.speech.tts.TextToSpeech.access$1100(TextToSpeech.java:59)
    at android.speech.tts.TextToSpeech$12.run(TextToSpeech.java:1581)
    at android.speech.tts.TextToSpeech$12.run(TextToSpeech.java:1531)
    at android.speech.tts.TextToSpeech$Connection.runAction(TextToSpeech.java:2337)
    at android.speech.tts.TextToSpeech.runAction(TextToSpeech.java:747)
    at android.speech.tts.TextToSpeech.runAction(TextToSpeech.java:737)
    at android.speech.tts.TextToSpeech.setLanguage(TextToSpeech.java:1531)
    at com.wordsbaking.cordova.tts.TTS.onInit(TTS.java:86)
    at android.speech.tts.TextToSpeech.dispatchOnInit(TextToSpeech.java:820)
    at android.speech.tts.TextToSpeech.access$1900(TextToSpeech.java:59)
    at android.speech.tts.TextToSpeech$Connection$SetupConnectionAsyncTask.onPostExecute(TextToSpeech.java:2251)
    at android.speech.tts.TextToSpeech$Connection$SetupConnectionAsyncTask.onPostExecute(TextToSpeech.java:2206)
    at android.os.AsyncTask.finish(AsyncTask.java:651)
    at android.os.AsyncTask.access$500(AsyncTask.java:180)
    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7225)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
deangelo200 commented 7 years ago

update your android sdk and use this $$(document).on('deviceready', function() {

window.TTS.speak({ text: "Hello World" locale: 'en-GB', rate: 1.3 }, function () { // Do Something after success }, function (reason) { // Handle the error case }); });

technotip commented 7 years ago

Am totally confused ..where is the audio output? Inside success function?? I want to know the result structure, so that I can extract audio from it.

Or am I missing something here?

ozexpert commented 7 years ago

@technotip it won't give you the audio, it will just play ;-) success callback is called when tts starts playing

technotip commented 7 years ago

Ya got it. Thanks ..

caleb87 commented 7 years ago

I have this problem as well; unfortunately, it's from a customer and I cannot replicate it on any of my Android devices.

The docs show


iOS 7+
Windows Phone 8
Android 4.0.3+ (API Level 15+)

My PGB config is:

<preference name="android-minSdkVersion" value="9" />
<preference name="android-targetSdkVersion" value="16" />

The SDK version is higher than the docs show. I could raise it to 21, but I'm unsure if this would even solve the issue.

Any insight?

Edit: The customer has Android 6.0.

baskin commented 6 years ago

Any update guys. I saw this happen with Samsung devices running android 6 only. Happens when I try to speak using a non available locale.

canadaka commented 6 years ago

This is still happening, only on "Samsung Galaxy S5" devices running Android 6.0.1

com.wordsbaking.cordova.tts.TTS.onInit

The crash happens on launch of the app, the tts speech plugin is not even called.

image