class WahWah::Mp3::VbriHeader

VBRI header structure:

Position Length Meaning 0 4 VBR header ID in 4 ASCII chars, always 'VBRI', not NULL-terminated

4 2 Version ID as Big-Endian 16-bit unsigned

6 2 Delay as Big-Endian float

8 2 Quality indicator

10 4 Number of Bytes as Big-Endian 32-bit unsigned

14 4 Number of Frames as Big-Endian 32-bit unsigned

18 2 Number of entries within TOC table as Big-Endian 16-bit unsigned

20 2 Scale factor of TOC table entries as Big-Endian 32-bit unsigned

22 2 Size per table entry in bytes (max 4) as Big-Endian 16-bit unsigned

24 2 Frames per table entry as Big-Endian 16-bit unsigned

26 TOC entries for seeking as Big-Endian integral.

From size per table entry and number of entries,
you can calculate the length of this field.

Constants

HEADER_FORMAT
HEADER_SIZE

Attributes

bytes_count[R]
frames_count[R]

Public Class Methods

new(file_io, offset = 0) click to toggle source
# File lib/wahwah/mp3/vbri_header.rb, line 37
def initialize(file_io, offset = 0)
  file_io.seek(offset)
  @id, @bytes_count, @frames_count = file_io.read(HEADER_SIZE)&.unpack(HEADER_FORMAT)
end

Public Instance Methods

valid?() click to toggle source
# File lib/wahwah/mp3/vbri_header.rb, line 42
def valid?
  @id == 'VBRI'
end