lib/parsers/mp3_parser.rb
def sync_bytes_offset_in_4_byte_seq(four_bytes)
    four_bytes[0...3].each_with_index do |byte, i|
      next_byte = four_bytes[i + 1]
      return i if byte == 0xFF && next_byte > 0xE0
    end
    four_bytes[-1] == 0xFF ? 3 : 4
  end
# Scan 4 byte values, and check whether there is
# a pattern of the 11 set bits anywhere within it
# or whether there is the 0xFF byte at the end
Scan 4 byte values, and check whether there is
a pattern of the 11 set bits anywhere within it
or whether there is the 0xFF byte at the end
Scan 4 byte values and check whether there is a pattern of the 11 set bits anywhere within it or whether there is the 0xFF byte at the end
def sync_bytes_offset_in_4_byte_seq(four_bytes)
    four_bytes[0...3].each_with_index do |byte, i|
      next_byte = four_bytes[i + 1]
      return i if byte == 0xFF && next_byte > 0xE0
    end
    four_bytes[-1] == 0xFF ? 3 : 4
  end
def sync_bytes_offset_in_4_byte_seq ( four_bytes ) four_bytes [ 0 ... 3 ] . each_with_index do | byte , i | next_byte = four_bytes [ i + 1 ] return i if byte == 0xFF && next_byte > 0xE0 end four_bytes [ - 1 ] == 0xFF ? 3 : 4 end
Scan 4 byte values, and check whether there is
a pattern of the 11 set bits anywhere within it
or whether there is the 0xFF byte at the end
Scan 4 byte values and check whether there is a pattern of the 11 set bits anywhere within it or whether there is the 0xFF byte at the end
four_bytes