class WaveFile::SMPTETimecode

Represents an SMPTE timecode: en.wikipedia.org/wiki/SMPTE_timecode If a *.wav file has a “smpl” chunk, then Reader#sampler_info#smpte_offset will return an instance of this class.

Attributes

frames[R]
hours[R]
minutes[R]
seconds[R]

Public

↑ top

Public Class Methods

new(hours: required("hours"), minutes: required("minutes"), seconds: required("seconds"), frames: required("frames")) click to toggle source

Constructs a new SMPTETimecode instance.

Returns

Raises InvalidSMPTETimecodeError if the given arguments can’t be written to a *.wav file.

# File lib/wavefile/smpte_timecode.rb, line 21
def initialize(hours: required("hours"),
               minutes: required("minutes"),
               seconds: required("seconds"),
               frames: required("frames"))
  validate_8_bit_signed_integer_field(hours, "hours")
  validate_8_bit_unsigned_integer_field(minutes, "minutes")
  validate_8_bit_unsigned_integer_field(seconds, "seconds")
  validate_8_bit_unsigned_integer_field(frames, "frames")

  @hours = hours
  @minutes = minutes
  @seconds = seconds
  @frames = frames
end