In order to transform a byte array to an int24, you need to know the endianness of the data. This means: the information if 11 22 33
is supposed to mean 0x112233
or 0x332211
.
Depending on this endianness, you can convert the data such as
int24 result_bigendian = array[0] * 65536 + array[1] * 256 + array[2] // (1)
or
int24 result_littleendian = array[2] * 65536 + array[1] * 256 + array[0] // (2)
(resp.
int24 result_littleendian = array[0] + array[1] * 256 + array[2] * 65536 // (3)
if you prefer that; note the difference to (1))
I don't know about C#; there may be an easier way to reach the goal.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…