def adpcm2lin(cp, size, state): _check_size(size) state = _check_state(state) rv = ffi.new("unsigned char[]", len(cp) * size * 2) state_ptr = ffi.new("int[]", state) lib.adcpm2lin(rv, cp, len(cp), size, state_ptr) return ffi.buffer(rv)[:], tuple(state_ptr)