I have written a code for getting frequency of audio.
I have used Zero Crossing algorithm to convert short array into frequency(int).
It works fine.
Whenever I play 2500Hz Audio Frequency in my PC It gives me perfect value.
e.g. 2500Hz=1400
If I play 2500Hz Audio Frequency for 10sec it gives me 1400 for 10sec.
So I can say that it works fine without any problem. There is no any issue with code.
But Now My problem is that whenever I change Device the output also changed.
e.g above output I get when I use Samsung GT-i5700.(Android 2.2)
But When I use Micro-max A-60(Android 2.1) It gives me output like that 2500Hz=771.
I can't find the reason,why output is changed when device is changed?
How can I solve this?
Is there any connection between android version and audio frequency?
Note:
I have cable which gives output from PC speaker to Devices MIC. So I can play Tone in PC and send it directly to Device MIC.