I have a targetDataLine open...
byte[] bytes = new byte[line.getBufferSize() / 5];
line.read(bytes, 0, bytes.length);
The bytes array is in hex, how do I get it's contents to be represented as decimal values?
I have a targetDataLine open...
byte[] bytes = new byte[line.getBufferSize() / 5];
line.read(bytes, 0, bytes.length);
The bytes array is in hex, how do I get it's contents to be represented as decimal values?
int decValue = Integer.parseInt(hexString, 16);
Resources: http://www.tutorialspoint.com/java/number_parseint.htm
Unsure of the OP's posting language.
In Python, if you have an array and you want to get the decimal values of the bytes, you could loop through and use ord() to get the decimal representation.
If you had to convert from an actual array containing hex values, then you can do the conversion as per this StackOverflow posting: