html5 - Decibel Sound Meter for Android -
i new android , looking write app measuring decibel sound level. idea when sound reaches level user gets alert. that's it. can me out this. can using html5/javascript ? appreciated.
taken android media player decibel reading
for native android/java based decibel calculation mediarecorder:
mrecorder = new mediarecorder(); mrecorder.setaudiosource(mediarecorder.audiosource.mic); mrecorder.setoutputformat(mediarecorder.outputformat.three_gpp); mrecorder.setaudioencoder(mediarecorder.audioencoder.amr_nb); mrecorder.setoutputfile("/dev/null"); mrecorder.prepare(); mrecorder.start(); public double getamplitude() { if (mrecorder != null) return (mrecorder.getmaxamplitude()); else return 0; }
to calculate db value :
powerdb = 20 * log10(getamplitude() / referenceamp);
reference: http://en.wikipedia.org/wiki/decibel#field_quantities
not sure if in html5 on android
Comments
Post a Comment