I have an ByteArrayOutputStream connected with a Dataline from an AudioSource. I need to convert the Stream in some significative values that probally are the sound values taken from source or not ?
Well then how can I conver the byteArray (from ByteArrayOutStream.getByteArray()) in a intArray?. I googled it but with no luck .
p.s. the audioFormat that I used is : PCM_SIGNED 192.0Hz 16Bit big endian
Use a ByteBuffer. You can convert not only to different array types this way, but also deal with endian issues.
You can try the following:
ByteBuffer.wrap(byteArray).asIntBuffer().array()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With