So jnajack uses a different presentation of audio data than the standard api java sound functions.
I don't see it in the jnajack specs, but I think it presents the audio as floating between -1 and 1.
I am not very familiar with the Java Sound API, but I can imagine that it uses bytes in the range from -128 to 127.
In other words, you will need to convert between them by multiplying by 128.
I would say that a neat way to do this would be byte converted = Float.valueOf(original * 128).byteValue(). If necessary, perhaps this can only be done with primitives, which should be faster.
source
share