wirthual / HyperionAuvi

Experimental Android App to visualize music output on hyperion
https://github.com/hyperion-project
2 stars 0 forks source link

Help with FFT #1

Open vbisbest opened 7 years ago

vbisbest commented 7 years ago

Hi, I am working on a similar project but having trouble with the FFT logic. I am following your OnFFTCapture function with this code:

for(int i=2;i<fft.length;i=i+2){ int rfk = fft[i]; int ifk = fft[i+1]; float magnitude = (float) Math.sqrt((double) (rfk * rfk + ifk * ifk)); magnitudesList.add(magnitude); } My issue is every value in the magnitudesList is always 255 or 361. It just does not make sense. What values should I be getting? Thanks!

wirthual commented 7 years ago

Actually the value should be changing depending on the sound you play on your phone. What are you playing when testing the method?

Here is the useful documentation to understand whats going on there: https://developer.android.com/reference/android/media/audiofx/Visualizer.html#getFft(byte[])

vbisbest commented 7 years ago

I am playing music on the device capturing on (0) which is main mix. I think its a Xamarin bug. I made a post on the forums with details: https://forums.xamarin.com/discussion/95784/bad-fft-data-in-onfftdatacapture

Can you tell me if you see the same thing? Thanks!

wirthual commented 7 years ago

Hi, sorry but I am not developing with Xamarin. However when I developed the app, the values were changing for sure :)