Class: Scissor::SoundFile::Wav

Inherits:
Scissor::SoundFile show all
Defined in:
lib/scissor/sound_file.rb

Constant Summary

Constants inherited from Scissor::SoundFile

SUPPORTED_FORMATS

Instance Method Summary collapse

Methods inherited from Scissor::SoundFile

#initialize, new_from_filename

Constructor Details

This class inherits a constructor from Scissor::SoundFile

Instance Method Details

#lengthObject



25
26
27
# File 'lib/scissor/sound_file.rb', line 25

def length
  data.length / fmt.body.unpack('s2i2')[3].to_f
end

#mono?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/scissor/sound_file.rb', line 29

def mono?
  fmt.body.unpack('s2')[1] == 1
end