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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -