Closed jijkbird closed 3 years ago
Hi @jijkbird
I was able to reproduce the error on android. Thank you for letting me know about this bug, I will provide an update in the near future!
Hi @jijkbird,
I have provided a fix on version 0.2.0. Please let me know if you still experience the same error.
It's solved. Thank you,
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.6 20G165 darwin-x64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] IntelliJ IDEA Ultimate Edition (version 2021.2.1) [✓] VS Code (version 1.61.0) [✓] Connected device (2 available)
_initialize() async { advancedPlayer.stop(); isRecording = true; result = TfliteAudio.startAudioRecognition( numOfInferences: 1000, inputType: this.inputType, sampleRate: this.sampleRate, recordingLength: this.recordingLength, bufferSize: this.bufferSize, detectionThreshold: 0.6, averageWindowDuration: 2000, minimumTimeBetweenSamples: 100, suppressionTime: 2000, ); setState(() {});
}
V/Tflite_audio( 8040): recordingOffset: 110250/44032000 V/Tflite_audio( 8040): recordingOffset: 121275/44032000 V/Tflite_audio( 8040): recordingOffset: 132300/44032000 V/Tflite_audio( 8040): Recording reached threshold V/Tflite_audio( 8040): recordingOffset: 139776/44032000 V/Tflite_audio( 8040): Creating new threshold V/Tflite_audio( 8040): Recognition started. V/Tflite_audio( 8040): Input shape: [1, 44032] E/AndroidRuntime( 8040): FATAL EXCEPTION: Thread-73 E/AndroidRuntime( 8040): Process: com.sankoumu.piano, PID: 8040 E/AndroidRuntime( 8040): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.get(java.lang.Object)' on a null object reference E/AndroidRuntime( 8040): at flutter.tflite_audio.TfliteAudioPlugin.recognize(TfliteAudioPlugin.java:514) E/AndroidRuntime( 8040): at flutter.tflite_audio.TfliteAudioPlugin.access$100(TfliteAudioPlugin.java:59) E/AndroidRuntime( 8040): at flutter.tflite_audio.TfliteAudioPlugin$4.run(TfliteAudioPlugin.java:494) E/AndroidRuntime( 8040): at java.lang.Thread.run(Thread.java:923) I/Process ( 8040): Sending signal. PID: 8040 SIG: 9
When it is opened and closed continuously, an exception occurs.