Class: Ogg::Vorbis::HeaderPacket

Inherits:
Packet
  • Object
show all
Defined in:
lib/ogginfo-rb.rb

Overview

This class forms a basis for other Vorbis header packets. See www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-610004.2.1

Instance Attribute Summary collapse

Attributes inherited from Packet

#data

Instance Method Summary collapse

Methods inherited from Packet

#next_page

Constructor Details

#initialize(page) ⇒ HeaderPacket

Returns a new instance of HeaderPacket.



171
172
173
174
175
176
177
178
179
# File 'lib/ogginfo-rb.rb', line 171

def initialize page
  super

  @packet_type = @data.read(1).unpack('C').first
  vorbis_check = @data.read(6)
  unless vorbis_check == 'vorbis'
    $stderr.puts "Warning: 'vorbis' string not found in header"
  end
end

Instance Attribute Details

#packet_typeObject (readonly)

Returns the value of attribute packet_type.



169
170
171
# File 'lib/ogginfo-rb.rb', line 169

def packet_type
  @packet_type
end