Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Range of values for GetMaxAmplitude

Tags:

android

I've got an interesting idea for an outside of the box use of the mic port on an android phone. I'm brainstorming ways to use an android phone to log roast temperatures inside my coffee roaster. The thought popped into my head. A microphone is a low-voltage and so is my thermocouple. So I started looking through the android methods to see if there was anything that might allow me to get the actual millivolt reading from the port. The GetMaxAmplitude function is the only thing I found. Does anyone know the range of values that are returned by the GetMaxAmplitude function?

If you know that this will not work, just let me know.

Thanks in advance,

like image 743
ZHawke Avatar asked Nov 11 '10 11:11

ZHawke


1 Answers

Well, I myself have been working to find the absolute rang of values that come from the getMaxAmplitude() function, but I haven't been able to find any exact answers. There was one thread that said that voices can return anything from 0 to 25000. I do know that the minimum value is 0. Also, it returns an Integer, which can only contain whole numbers, so I don't think that it is actually returning the raw millivolt reading, since that would typically contain decimals, too.

Very interesting idea though!!

maybe something here will help:

Microphone input

EDIT:

I have discovered the max value! it is 32767, which is the max for a signed 16-bit integer. The minimum value is of course, 0, because you can't have less than no sound. This also supports the theory that getMaxAmplitude() doesn't return the actual millivolt value, because getting 32.8 volts out of a microphone...isn't going to happen.

like image 163
Brandon Avatar answered Sep 26 '22 04:09

Brandon