plyer icon indicating copy to clipboard operation
plyer copied to clipboard

plyer RECORD_AUDIO does not work

Open allebonvi opened this issue 3 years ago • 1 comments

Hello everybody , i m trying to make the https://github.com/kivy/plyer/tree/master/examples/speech2text exmple work on my android 10 huaway phone

i receive the error in the subject

in buildozer my permissions is set to android.permissions = INTERNET, ACCESS_NETWORK_STATE, VIBRATE, RECORD_AUDIO, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE

and the reuirements are requirements = python3,kivy,plyer,SpeechRecognition,android i granted manually permissions on my apk microphone and storage.

No one error arise form the log except for the one in subject and the followings that are relevant, i think

PLEase may you help me to understand whats happening and to find a solution? I really really need this piece of code working ...i am trying to demonstrate that kivy is a really productive technology in respect to java and others so for my target this way to simplify the access to java runtime si crucial Thank you a lot in advance


03-18 22:38:44.860 4384 4384 I A : RecognitionService#onStartListening 03-18 22:38:44.861 4384 4384 W Bundle : Key calling_package expected String but value was a [C. The default value was returned. 03-18 22:38:44.861 1473 4839 W ProcBatteryStats: timer is not running , not stop, name: com.huawei.android.totemweather, uid: 10040, tag: location 03-18 22:38:44.861 4384 4384 W Bundle : Attempt to cast generated internal exception: 03-18 22:38:44.861 4384 4384 W Bundle : java.lang.ClassCastException: char[] cannot be cast to java.lang.String 03-18 22:38:44.861 4384 4384 W Bundle : at android.os.BaseBundle.getString(BaseBundle.java:1167) 03-18 22:38:44.861 4384 4384 W Bundle : at android.content.Intent.getStringExtra(Intent.java:8058) 03-18 22:38:44.861 4384 4384 W Bundle : at com.google.android.apps.search.transcription.g.e.j.a(SourceFile:3) 03-18 22:38:44.861 4384 4384 W Bundle : at com.google.android.apps.search.transcription.g.e.i.a(SourceFile:3) 03-18 22:38:44.861 4384 4384 W Bundle : at com.google.android.voicesearch.serviceapi.GoogleRecognitionService.onStartListening(SourceFile:7) 03-18 22:38:44.861 4384 4384 W Bundle : at android.speech.RecognitionService.dispatchStartListening(RecognitionService.java:113) 03-18 22:38:44.861 4384 4384 W Bundle : at android.speech.RecognitionService.access$000(RecognitionService.java:39) 03-18 22:38:44.861 4384 4384 W Bundle : at android.speech.RecognitionService$1.handleMessage(RecognitionService.java:82) 03-18 22:38:44.861 4384 4384 W Bundle : at android.os.Handler.dispatchMessage(Handler.java:107) 03-18 22:38:44.861 4384 4384 W Bundle : at android.os.Looper.loop(Looper.java:213) 03-18 22:38:44.861 4384 4384 W Bundle : at android.app.ActivityThread.main(ActivityThread.java:8178) 03-18 22:38:44.861 4384 4384 W Bundle : at java.lang.reflect.Method.invoke(Native Method) 03-18 22:38:44.861 4384 4384 W Bundle : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 03-18 22:38:44.861 4384 4384 W Bundle : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 03-18 22:38:44.862 4384 4384 I A : Using Locale.getDefault() for recognition: null 03-18 22:38:44.862 1473 4839 I LocationManagerService: requestingHighPowerLocation = false 03-18 22:38:44.863 4384 4384 W Bundle : Key calling_package expected String but value was a [C. The default value was returned. 03-18 22:38:44.863 4384 4384 W Bundle : Attempt to cast generated internal exception: 03-18 22:38:44.863 4384 4384 W Bundle : java.lang.ClassCastException: char[] cannot be cast to java.lang.String 03-18 22:38:44.863 4384 4384 W Bundle : at android.os.BaseBundle.getString(BaseBundle.java:1167) 03-18 22:38:44.863 4384 4384 W Bundle : at android.content.Intent.getStringExtra(Intent.java:8058) 03-18 22:38:44.863 4384 4384 W Bundle : at com.google.android.apps.search.transcription.g.e.j.a(SourceFile:3) 03-18 22:38:44.863 4384 4384 W Bundle : at com.google.android.apps.search.transcription.g.e.i.a(SourceFile:19) 03-18 22:38:44.863 4384 4384 W Bundle : at com.google.android.voicesearch.serviceapi.GoogleRecognitionService.onStartListening(SourceFile:7) 03-18 22:38:44.863 4384 4384 W Bundle : at android.speech.RecognitionService.dispatchStartListening(RecognitionService.java:113) 03-18 22:38:44.863 4384 4384 W Bundle : at android.speech.RecognitionService.access$000(RecognitionService.java:39) 03-18 22:38:44.863 4384 4384 W Bundle : at android.speech.RecognitionService$1.handleMessage(RecognitionService.java:82) 03-18 22:38:44.863 4384 4384 W Bundle : at android.os.Handler.dispatchMessage(Handler.java:107) 03-18 22:38:44.863 4384 4384 W Bundle : at android.os.Looper.loop(Looper.java:213) 03-18 22:38:44.863 4384 4384 W Bundle : at android.app.ActivityThread.main(ActivityThread.java:8178) 03-18 22:38:44.863 4384 4384 W Bundle : at java.lang.reflect.Method.invoke(Native Method) 03-18 22:38:44.863 4384 4384 W Bundle : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 03-18 22:38:44.863 4384 4384 W Bundle : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) 03-18 22:38:44.864 4384 4384 E A : Error parsing intent: EXTRA_PREFER_OFFLINE parameter is deprecated. 03-18 22:38:44.866 2258 2468 D DeviceMonitor: GPS request stop:com.huawei.android.totemweather pid:2308 interval(s): -1 reqId:b241c06 03-18 22:38:44.875 2222 12396 I GCoreUlr: Successfully inserted 1 locations 03-18 22:38:44.876 4384 12238 W Binder : Caught a RuntimeException from the binder stub implementation. 03-18 22:38:44.876 4384 12238 W Binder : java.lang.SecurityException: uid 10125 does not have android.permission.UPDATE_APP_OPS_STATS. 03-18 22:38:44.876 4384 12238 W Binder : at android.os.Parcel.createException(Parcel.java:2071) 03-18 22:38:44.876 4384 12238 W Binder : at android.os.Parcel.readException(Parcel.java:2039) 03-18 22:38:44.876 4384 12238 W Binder : at android.os.Parcel.readException(Parcel.java:1987) 03-18 22:38:44.876 4384 12238 W Binder : at com.android.internal.app.IAppOpsService$Stub$Proxy.checkOperationRaw(IAppOpsService.java:1617) 03-18 22:38:44.876 4384 12238 W Binder : at android.app.AppOpsManager.unsafeCheckOpRawNoThrow(AppOpsManager.java:5004) 03-18 22:38:44.876 4384 12238 W Binder : at android.content.PermissionChecker.checkPermissionCommon(PermissionChecker.java:402) 03-18 22:38:44.876 4384 12238 W Binder : at android.content.PermissionChecker.checkPermissionForPreflight(PermissionChecker.java:162) 03-18 22:38:44.876 4384 12238 W Binder : at android.content.PermissionChecker.checkCallingOrSelfPermissionForPreflight(PermissionChecker.java:372) 03-18 22:38:44.876 4384 12238 W Binder : at android.speech.RecognitionService.checkPermissions(RecognitionService.java:185) 03-18 22:38:44.876 4384 12238 W Binder : at android.speech.RecognitionService.access$700(RecognitionService.java:39) 03-18 22:38:44.876 4384 12238 W Binder : at android.speech.RecognitionService$RecognitionServiceBinder.cancel(RecognitionService.java:376) 03-18 22:38:44.876 4384 12238 W Binder : at android.speech.IRecognitionService$Stub.onTransact(IRecognitionService.java:149) 03-18 22:38:44.876 4384 12238 W Binder : at android.os.Binder.execTransactInternal(Binder.java:1028) 03-18 22:38:44.876 4384 12238 W Binder : at android.os.Binder.execTransact(Binder.java:1001) 03-18 22:38:44.876 4384 12238 W Binder : Caused by: android.os.RemoteException: Remote stack trace: 03-18 22:38:44.876 4384 12238 W Binder : at android.app.ContextImpl.enforce(ContextImpl.java:2001) 03-18 22:38:44.876 4384 12238 W Binder : at android.app.ContextImpl.enforcePermission(ContextImpl.java:2010) 03-18 22:38:44.876 4384 12238 W Binder : at com.android.server.appop.AppOpsService.verifyIncomingUid(AppOpsService.java:2470) 03-18 22:38:44.876 4384 12238 W Binder : at com.android.server.appop.AppOpsService.checkOperationImpl(AppOpsService.java:1828) 03-18 22:38:44.876 4384 12238 W Binder : at com.android.server.appop.AppOpsService.checkOperationInternal(AppOpsService.java:1820) 03-18 22:38:44.876 4384 12238 W Binder : 03-18 22:38:44.879 1473 1717 W ProcBatteryStats: timer is not running , not stop, name: com.google.android.gms, uid: 10120, tag: location 03-18 22:38:44.880 4384 4384 I A : RecognitionService#onDestroy 03-18 22:38:44.881 11532 11532 E SpeechRecognizer: not connected to the recognition service


allebonvi avatar Mar 18 '21 21:03 allebonvi

There is some issue in Main branch due to which it isn't working you can use my version which fixed these issues....https://github.com/AM-ash-OR-AM-I/SR Download this then just paste these in your working directory of buildozer. You should be able to get this to work...I forked this from https://github.com/Abhishek-op/SR who fixed most of the issues and I added permissions to get microphone to work

AM-ash-OR-AM-I avatar Jun 04 '21 13:06 AM-ash-OR-AM-I