code: @SuppressWarnings("WeakerAccess")
      public int segmentHeight(final int segment, final boolean front) {
          final ByteBuffer bytes = getData();
          if (isColor) {
              final int base = segment * 6;
              final int frontHeight = Util.unsign(bytes.get(base + 5));
              if (front) {
                  return frontHeight;
              } else {
                  return Math.max(frontHeight, Math.max(Util.unsign(bytes.get(base + 3)), Util.unsign(bytes.get(base + 4))));
              }
          } else {
              return getData().get(segment * 2) & 0x1f;
          }
      }
docs: Determine the height of the preview given an index into it.
  
  @param segment the index of the waveform preview segment to examine
  @param front if {@code true} the height of the front (brighter) segment of a color waveform preview is returned,
  otherwise the height of the back (dimmer) segment is returned. Has no effect for blue previews.
  
  @return a value from 0 to 31 representing the height of the waveform at that segment, which may be an average
  of a number of values starting there, determined by the scale