char5742 / flutter_silero_vad

This is an unofficial plugin for calling the Silero VAD ONNX model in Flutter.
Other
26 stars 14 forks source link

android release build got crash on screen where flutter_silero_vad packge used And in ios build failed with some git fetch error. got error code [404] #11

Open bhaumik1111 opened 3 months ago

bhaumik1111 commented 3 months ago

HI, I AM USING THIS PACKAGE IN MY PROJECT BUT IN RELEASE MODE I GOT CRASH WHEN I OPEN PERTICULAR SCREEN WHICH USES THIS PACKAGE.

HERE I GOT THE LOG AS BELOW. flutter_silero_test.txt

FLUTTER SDK VERSION : 3.10.6 -stable channel Dart version : 3.0.6

where i got error in attached file "flutter_silero_test.dart" relevant packages: audio_session: any flutter_sound: any

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): │ #0 new FlutterSoundRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:140:13) I/flutter (22444): │ #1 RecordToStreamExampleState._mRecorder (package:lawcanvas/views/common_widget/speech_to_text_api_based.dart:35:48) I/flutter (22444): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (22444): │ 🐛 ctor: FlutterSoundRecorder() I/flutter (22444): └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): │ #0 FlutterSoundRecorder.openRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:372:13) I/flutter (22444): │ #1 RecordToStreamExampleState._openRecorder (package:lawcanvas/views/common_widget/speech_to_text_api_based.dart:77:22) I/flutter (22444): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (22444): │ 🐛 FS:---> openAudioSession I/flutter (22444): └─────────────────────────────────── ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): │ #0 FlutterSoundRecorder._openAudioSession (package:flutter_sound/public/flutter_sound_recorder.dart:396:17) I/flutter (22444): │ #1 FlutterSoundRecorder.openRecorder. (package:flutter_sound/public/flutter_sound_recorder.dart:374:17) I/flutter (22444): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (22444): │ 🐛 Resetting flutter_sound Recorder Plugin I/flutter (22444): └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): │ #0 FlutterSoundRecorder._startRecorder (package:flutter_sound/public/flutter_sound_recorder.dart:614:13) I/flutter (22444): │ #1 FlutterSoundRecorder.startRecorder. (package:flutter_sound/public/flutter_sound_recorder.dart:592:13) I/flutter (22444): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (22444): │ 🐛 FS:---> _startRecorder. I/flutter (22444): └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/System.out(22444): ---> writeAudioDataToFile I/System.out(22444): <--- writeAudioDataToFile I/flutter (22444): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): │ #0 FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:234:13) I/flutter (22444): │ #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22) I/flutter (22444): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

I/flutter (22444): │ 🐛 ---> startRecorderCompleted: true I/flutter (22444): └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (22444): │ #0 FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound/public/flutter_sound_recorder.dart:243:13) I/flutter (22444): │ #1 MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22) I/flutter (22444): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (22444): │ 🐛 <--- startRecorderCompleted: true I/flutter (22444): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_21_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_20_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_12_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_11_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_10_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_5_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_4_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_13_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_3_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_18_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_19_output_0'. It is not used by any node and should be removed from the model.W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_107_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_103_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_101_output_0'. It is not used by any node and should be removed from the model. E/DartMessenger(22444): Uncaught exception in binary message listener E/DartMessenger(22444): ai.onnxruntime.OrtException: Unexpected number of inputs, expected [1,3) found 4 E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:259) E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:238) E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:207) E/DartMessenger(22444): at com.example.flutter_silero_vad.VadIterator.predict(VadItarator.kt:84) E/DartMessenger(22444): at com.example.flutter_silero_vad.FlutterSileroVadPlugin.onMethodCall(FlutterSileroVadPlugin.kt:39) E/DartMessenger(22444): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/Constant_2_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_27_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_28_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_21_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_20_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_19_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_22_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_30_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_14_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_11_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_12_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_29_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_then_branchInline_0/Constant_13_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/padding/Transpose_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0__/stft/padding/Slice_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0/stft/padding/Reshape_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branch__Inline_0/stft/padding/Concat_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0__/stft/padding/ConstantOfShape_output_0'. It is not used by any node and should be removed from the model. W/onnxruntime(22444): [W:onnxruntime:, graph.cc:3487 CleanUnusedInitializersAndNodeArgs] Removing initializer 'If_0_else_branchInline_0__/stft/padding/Constant_6_output_0'. It is not used by any node and should be removed from the model. E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/DartMessenger(22444): at android.os.Handler.handleCallback(Handler.java:789) E/DartMessenger(22444): at android.os.Handler.dispatchMessage(Handler.java:98) E/DartMessenger(22444): at android.os.Looper.loop(Looper.java:164) E/DartMessenger(22444): at android.app.ActivityThread.main(ActivityThread.java:6942) E/DartMessenger(22444): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger(22444): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) E/DartMessenger(22444): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) E/DartMessenger(22444): Uncaught exception in binary message listener E/DartMessenger(22444): ai.onnxruntime.OrtException: Unexpected number of inputs, expected [1,3) found 4 E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:259) E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:238) E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:207) E/DartMessenger(22444): at com.example.flutter_silero_vad.VadIterator.predict(VadItarator.kt:84) E/DartMessenger(22444): at com.example.flutter_silero_vad.FlutterSileroVadPlugin.onMethodCall(FlutterSileroVadPlugin.kt:39) E/DartMessenger(22444): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/DartMessenger(22444): at android.os.Handler.handleCallback(Handler.java:789) E/DartMessenger(22444): at android.os.Handler.dispatchMessage(Handler.java:98) E/DartMessenger(22444): at android.os.Looper.loop(Looper.java:164) E/DartMessenger(22444): at android.app.ActivityThread.main(ActivityThread.java:6942) E/DartMessenger(22444): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger(22444): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) E/DartMessenger(22444): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) E/DartMessenger(22444): Uncaught exception in binary message listener E/DartMessenger(22444): ai.onnxruntime.OrtException: Unexpected number of inputs, expected [1,3) found 4 E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:259) E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:238) E/DartMessenger(22444): at ai.onnxruntime.OrtSession.run(OrtSession.java:207) E/DartMessenger(22444): at com.example.flutter_silero_vad.VadIterator.predict(VadItarator.kt:84) E/DartMessenger(22444): at com.example.flutter_silero_vad.FlutterSileroVadPlugin.onMethodCall(FlutterSileroVadPlugin.kt:39) E/DartMessenger(22444): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/DartMessenger(22444): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/DartMessenger(22444): at android.os.Handler.handleCallback(Handler.java:789) E/DartMessenger(22444): at android.os.Handler.dispatchMessage(Handler.java:98) E/DartMessenger(22444): at android.os.Looper.loop(Looper.java:164) E/DartMessenger(22444): at android.app.ActivityThread.main(ActivityThread.java:6942) E/DartMessenger(22444): at java.lang.reflect.Method.invoke(Native Method) E/DartMessenger(22444): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) E/DartMessenger(22444): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) I/flutter (22444): ERROR==>MissingPluginException(No implementation found for method predict on channel flutter_silero_vad) I/flutter (22444): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7) I/flutter (22444): I/flutter (22444): #1 MethodChannelFlutterSileroVad.predict (package:flutter_silero_vad/flutter_silero_vad_method_channel.dart:39:17) I/flutter (22444): I/flutter (22444): #2 RecordToStreamExampleState._handleProcessedAudio (package:project/common_widget/speech_to_text_api_based.dart:178:9) I/flutter (22444): I/flutter (22444): #3 RecordToStreamExampleState.record. (package:project/common_widget/speech_to_text_api_based.dart:136:13) I/flutter (22444):

I/flutter (22444): #2 RecordToStreamExampleState._handleProcessedAudio (package:project/common_widget/speech_to_text_api_based.dart:178:9) I/flutter (22444): I/flutter (22444): #3 RecordToStreamExampleState.record. (package:project/common_widget/speech_to_text_api_based.dart:136:13) I/flutter (22444): I/flutter (22444): ERROR==>MissingPluginException(No implementation found for method predict on channel flutter_silero_vad)

Kavinkumar-97 commented 2 months ago

@bhaumik1111, I encountered the same issue yesterday and explored numerous solutions. Ultimately, I resolved it by adding minifyEnabled false and shrinkResources false in the release config in app/build.gradle.

Additionally, I incorporated the platform-specific implementation of this plugin directly into my Flutter project. This involved including the platform-specific code and its dependencies within my app’s Android and iOS projects and adding the method channels in the Flutter project. While this step is optional, if you continue to experience the issue after adjusting minifyEnabled and shrinkResources, you might want to try this approach as well.