I’m recording some audio in an Android app, and now I want to know that’s the samples’ value I’m getting. Since the record is in bytes, I would like to convert it to int or floats, to compare signal levels easier.
I’m trying to do so with this script, but it doesn’t work:
byte data[] = new byte[bufferSize];
read = recorder.read(data, 0, bufferSize);
int dataInt[]= new int[bufferSize];//To convert into int
for (int j=0; j<bufferSize ; j++)
{
dataInt[j]=data[j].intValue();
}
Could anyone tell me what am I doint wrong?
Thank you very much.
You are calling intValue() on a primitive byte value! Why can’t you just do