slins-23 / flutter-fft Goto Github PK
View Code? Open in Web Editor NEWFlutter pitch detection/audio processing plugin, personalized for my guitar tuner application.
License: MIT License
Flutter pitch detection/audio processing plugin, personalized for my guitar tuner application.
License: MIT License
I've successfully converted to a piano tuner
But sometimes there are exceptions
I'm using flitter 1.22
D/FlutterFftPlugin(17488): KOKOKOKKOK, Excep: java.lang.IndexOutOfBoundsException: Index: 96, Size: 96
D/FlutterFftPlugin(17488): Exception: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(17488): FATAL EXCEPTION: main
E/AndroidRuntime(17488): Process: com.sankoumu.piano, PID: 17488
E/AndroidRuntime(17488): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(17488): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
E/AndroidRuntime(17488): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:243)
E/AndroidRuntime(17488): at com.slins.flutterfft.PitchModel.updateFrequencyAndNote(PitchModel.java:90)
E/AndroidRuntime(17488): at com.slins.flutterfft.FlutterFftPlugin.lambda$startRecorder$2$FlutterFftPlugin(FlutterFftPlugin.java:132)
E/AndroidRuntime(17488): at com.slins.flutterfft.-$$Lambda$FlutterFftPlugin$pF_eBEYizOoYVMOf-xcXt-dNttY.run(Unknown Source:4)
E/AndroidRuntime(17488): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(17488): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(17488): at android.os.Looper.loop(Looper.java:233)
E/AndroidRuntime(17488): at android.app.ActivityThread.main(ActivityThread.java:8010)
E/AndroidRuntime(17488): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17488): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
E/AndroidRuntime(17488): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
I/flutter (29245): Octave: 2
I/flutter (29245): Changed state, received: [1.0, 83.06700134277344, E, 82.40689086914062, 0.6601104736328125, 2, E, 82.40689086914062, 54.716590881347656, 2, true]
I/flutter (29245): Octave: 2
I/flutter (29245): Changed state, received: [1.0, 83.07037353515625, E, 82.40689086914062, 0.663482666015625, 2, E, 82.40689086914062, 54.716590881347656, 2, true]
I/flutter (29245): Octave: 2
D/FlutterFftPlugin(29245): KOKOKOKKOK, Excep: java.lang.IndexOutOfBoundsException: Index: 96, Size: 96
D/FlutterFftPlugin(29245): Exception: java.lang.IllegalStateException: Reply already submitted
D/AndroidRuntime(29245): Shutting down VM
E/AndroidRuntime(29245): FATAL EXCEPTION: main
E/AndroidRuntime(29245): Process: com.sankoumu.piano, PID: 29245
E/AndroidRuntime(29245): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(29245): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
E/AndroidRuntime(29245): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:243)
E/AndroidRuntime(29245): at com.slins.flutterfft.PitchModel.updateFrequencyAndNote(PitchModel.java:90)
E/AndroidRuntime(29245): at com.slins.flutterfft.FlutterFftPlugin.lambda$startRecorder$2$FlutterFftPlugin(FlutterFftPlugin.java:132)
E/AndroidRuntime(29245): at com.slins.flutterfft.-$$Lambda$FlutterFftPlugin$pF_eBEYizOoYVMOf-xcXt-dNttY.run(Unknown Source:4)
E/AndroidRuntime(29245): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(29245): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29245): at android.os.Looper.loop(Looper.java:233)
E/AndroidRuntime(29245): at android.app.ActivityThread.main(ActivityThread.java:8010)
E/AndroidRuntime(29245): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(29245): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
E/AndroidRuntime(29245): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
I/Process (29245): Sending signal. PID: 29245 SIG: 9
Failed to send request: {"jsonrpc":"2.0","id":"262","method":"getMemoryUsage","params":{"isolateId":"isolates/3908329695161291"}}
I reviewed the package and it's really good. There is no special package for frequency in Flutter but it works very well.
But it is not supported in iOS right now, I hope it will work properly on iOS in the future
While using, I find that data has 11 returned variables. I only know the meaning of data[1], data[2] and data[5], but I want to know what do other variables mean? Such like data[4] and data[5].
Thanks.
1.0.1
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287,
locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)
• No issues found!
I just ran an example code and it seems to be working for a 15-20 seconds. Then the app crashes with this:
Restarted application in 1 622ms.
D/FlutterFftPlugin( 6146): KOKOKOKKOK, Excep: java.lang.IndexOutOfBoundsException: Index: 96, Size: 96
D/FlutterFftPlugin( 6146): Exception: java.lang.IllegalStateException: Reply already submitted
D/AndroidRuntime( 6146): Shutting down VM
E/AndroidRuntime( 6146): FATAL EXCEPTION: main
E/AndroidRuntime( 6146): Process: com.example.tuner_app, PID: 6146
E/AndroidRuntime( 6146): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime( 6146): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:148)
E/AndroidRuntime( 6146): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:239)
E/AndroidRuntime( 6146): at com.slins.flutterfft.PitchModel.updateFrequencyAndNote(PitchModel.java:90)
E/AndroidRuntime( 6146): at com.slins.flutterfft.FlutterFftPlugin.lambda$startRecorder$2$FlutterFftPlugin(FlutterFftPlugin.java:132)
E/AndroidRuntime( 6146): at com.slins.flutterfft.-$$Lambda$FlutterFftPlugin$hUYDhPUP8CnO0Q6jSiEqk8q7Idw.run(Unknown Source:4)
E/AndroidRuntime( 6146): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime( 6146): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime( 6146): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime( 6146): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime( 6146): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6146): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
E/AndroidRuntime( 6146): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
I/Process ( 6146): Sending signal. PID: 6146 SIG: 9
Lost connection to device.
Exited (sigterm)
Any ideas how to resolve ?
This is a very good plugin, hope to see IOS support soon!
I am trying to create an app/website related to audio processing. As said in the title, is it possible to adjust the volume of a specific frequency?
How to make piano tuner
Using this plug-in can't recognize piano key tone normally
When calling method _async() (based off of example code in repo), nothing happens. Recording doesn't start, no streams opened, data isn't transferred. Tried moving _async() out of the init state and into a button but this didn't affect anything. Any advice?
1.0.1
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G73, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.48.2)
[✓] Connected device (1 available)
Emulator: Pixel 2 API 29 Android 10.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.