I have an Android application in Unity, which visualizes the audio that is played in AudioSource. It works very well in the editor and in building for desktop, but after building for Android, it lowers the resolution of the frequencies, and also the fps of the audio, and as a result, the visualization looks terrible.. If anyone knows how to get the full spectrum data as it happens in the editor and on the desktop, I would appreciate a solution 🙏
My code:
audioSource.GetSpectrumData(spectrumData, 0, FFTWindow.Blackman);
I tried using FFTWindow's Rectangular, Triangle, Hamming, Blackman, BlackmanHarris mode, and it didn't help.
spectrumDataarray? The array should have a size that is a power of two and the max size is 8192. The window just changes the leakage between the frequencies. Note that the quality is directly linked to the output device's sample rate since the FFT works on samples. So for debugging purposes you may want to print theAudioSettings.outputSampleRatefor both cases.