Here is soundtouch code about process the byte array. Did fmod has some api like this?(putSamples/receiveSamples)
private byte[] process(byte[] data, int readsize) throws IOException {
SoundTouch soundTouch = new SoundTouch();
// set parameter
short[] shortData = Utils.byteToShort(data, readsize);
soundTouch.putSamples(shortData, shortData.length);
while (true) {
buffer = Utils.shortToByte(soundTouch.receiveSamples());
if (buffer.length != 0) {
//do sth
} else {
break;
}
soundTouch.close();
}