Package 

Class AudioFrameComparator

  • All Implemented Interfaces:
    java.util.Comparator

    
    public class AudioFrameComparator
     implements Comparator<AudioFrameShort>
                        

    x = 0 if both "true" or both "false" x = 1 if 1st is "true" and 2nd is "false" x = -1 if 1st is "false" and 2nd is "true" y = 0 if both a == b y = 1 if a > b y = -1 if a < b so if x != 0 meaning both not same, in that case we will return as it is (true, if true or false, if false) because silence has higher priority rather than rms and the order is reversed. after confirming it's a voice we will look into rms values so when x == 0 meaning both are true or both are false we will simply return -y so the reverse order will be perfectly sorted.

    • Method Summary

      Modifier and Type Method Description
      int compare(AudioFrameShort o1, AudioFrameShort o2)
      • Methods inherited from class java.util.Comparator

        compare, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reverseOrder, reversed, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait