An option to stream the Waveform and FFT data as audio is being played. #867
DetainedDeveloper
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I am working on an Audio Visualizer.
I was able to make it work in Native Android and Now I am trying to make a plugin for it.
Basically, android already has a class called Visualizer (android.media.audiofx.Visualizer), which neends an integer AudioSessionId from MediaPlayer to initialize itself.
After that all you need, is to use the method visualizer.setOnDataCaptureListener()
It gives to two overridden methods,
onWaveFormDataCapture(Visualizer visualizer, byte[] waveform, int samplingRate)
onFftDataCapture(Visualizer visualizer, byte[] fft, int samplingRate)
Using the byte[] (Uint8List in Dart) you can do whatever you want with it.
byte[] waveform contains Amplitude (Volume) data
byte[] fft contains specific frequency data (As far as I know)
If you can stream both of them back to flutter https://github.com/iamSahdeep/FlutterVisualizers, I'm sure devs will be happy to use their favourite audio plugin and create visualizers with it!
I am trying to do it, but I'm sure you can write a better and cleaner code than me!
Also, in Line no. 73, if you set waveform and fft both to true, visualizer will capture both of them.
Beta Was this translation helpful? Give feedback.
All reactions