android - getMaxAmplitude() "always" reached -
i want app react on load sound clap. problem is, getmaxamplitude()
reaches it's maximum of 32762 when talking in normal voice >= "allmaxampli"
variable set in config mode.
the media recorder set this:
mrec = new mediarecorder(); mrec.setaudiosource(mediarecorder.audiosource.mic); mrec.setoutputformat(mediarecorder.outputformat.three_gpp); mrec.setaudioencoder(mediarecorder.audioencoder.amr_nb); [..] mrec.setoutputfile(audiofile.getabsolutepath()); mrec.prepare(); mrec.start();
and check done (abstracted):
int maxamp = mrec.getmaxamplitude(); if (maxamp >= calibamp) log.v("id", "max amp greater!");
did miss something?
is there other way measure volume, or increasing limit getmaxamplitude? thought using audiorecord, i'd have calculate amplitude hand. wanted save myself that.
i searched quite bit before considering posting, unable find anything. appreciated.
/edit: if calculate decibel out of amplitude, other values? might solve problem then.
/edit2: calculated decibel out of amplitude, problem persists, since amplitude high time. nobody has idea? :/
/edit3: after testing other apps seems general problem android. why every sound measuring app free..
Comments
Post a Comment