how can I process audio buffer like soundtouch style?

(flyswan) #1

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 {

(Cameron Baron) #2

Depending on what you are wanting to do, you may want to either use FMOD::sound::readData or FMOD::sound::lock

These are also used in our LowLevel examples if you wanted to see them being used.