public static void deinterleave ( AudioFormat format , ByteBuffer inb , ByteBuffer [ ] outs ) { int bytesPerSample = format . getSampleSizeInBits ( ) >> 3 ; int bytesPerFrame = bytesPerSample * outs . length ; while ( inb . remaining ( ) >= bytesPerFrame ) { for ( int j = 0 ; j < outs . length ; j ++ ) { for ( int i = 0 ; i < bytesPerSample ; i ++ ) { outs [ j ] . put ( inb . get ( ) ) ; } } } }
Deinterleaves audio samples from inb into outs using sample size from format