I have created a application that get the getMaxAmpitude and then converts it to decibels but i only get a range of 30dB.
Does an android phone only have a range of 30dB or is it a problem in my code?
public class getMaxAmpitude extends AsyncTask<Void, Float, Void>{
String dB = "";
int ampitude;
float db;
@Override
public Void doInBackground(Void... params) {
while(rec == true){
try{
Thread.sleep(250);
}catch(InterruptedException e){
e.printStackTrace();
}
ampitude = recorder.getMaxAmplitude();
db =(float) (20 * Math.log10(ampitude/700.0));
publishProgress(db);
}
return null;
}
public void onProgressUpdate(Float... progress){
//database.addSoundData(dB);
dB = (progress[0].toString());