Is it possible to make flash blink on ringtone, according to the beats of a song set as ringtone on phone in android.If yes then please give me a hint.
Asked
Active
Viewed 131 times
1 Answers
0
Yes and no. I've once written a FFT for acceleration sensor data of the devices. This was to find out what step frequence a user is running.
You can do FFT on an Android phone. I used the Apache Commons Math library for it.
Easiest starting point is to have WAV or FLAC Audio files as they do not have compressions or the like in it. You can straight do the FFT on them.
In my running app it takes about 1-2 seconds(!) to calculate one FFT for 512 input values, utilizing the CPU for 100% and draining the battery correspondingly. So I do the FFT only once a minute.
I can assume, that the user would see this, when the telephone rings:
- No blinking light, just sound for the first view seconds (while you do the FFT)
- The blinking light with the frequence of the beats but not in sync with them (you're showing the beats of a past time period)
But I must admit, that I really like the idea. Let me know, when you're out with your App :-)

jboi
- 11,324
- 4
- 36
- 43
-
Thank you for the suggestion but my problem is bit different : case 1 : When I have a song which is present in sd card or internal memory , I play the song using media player and get the FFT Data of a song to be played . But when some one call on phone Android play the ringtone and I want the FFT Data of that song which is played by Android. case 2 : I want to create an app in which when anyone call on my phone , I want to blink flash light with the beats of a ringtone . So Problem is how to get FFT Data of song which I am not playing , which is played by Android (Ringtone). – user2941232 Nov 01 '13 at 07:52
-
I dint think that there is a good and easy way for case 2. If you go from [here](http://stackoverflow.com/questions/19138870/get-raw-voice-recording-from-androids-search-framework) thru the links to other questions tothe answers there. You might find a way to record what Android plays currently. To he honest. It does nit look too promising. – jboi Nov 01 '13 at 14:09