private void encode(int num_bytes, bool use_shorts) { if (!running) { return; } if (num_bytes > 0) { if (use_shorts) { audioEncoder.encode(shortsBuffer, 0, num_bytes); } else { audioEncoder.encode(buffer, 0, num_bytes); } } }
private void encode(byte[] buffer, int offset, int size) { if (!running) { return; } if (size > 0) { try { audioEncoder.encode(buffer, offset, size); }catch (Exception e) { Logging.error("Exception occured in encode loop: " + e); } } }