Example #1
0
 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);
         }
     }
 }
Example #2
0
 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);
         }
     }
 }