Class: Scissor::SoundFile
- Inherits:
-
Object
- Object
- Scissor::SoundFile
- Defined in:
- lib/scissor/sound_file.rb
Defined Under Namespace
Classes: Error, M4a, Mp3, UnknownFormat, Wav
Constant Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename) ⇒ SoundFile
constructor
A new instance of SoundFile.
Constructor Details
#initialize(filename) ⇒ SoundFile
Returns a new instance of SoundFile.
84 85 86 |
# File 'lib/scissor/sound_file.rb', line 84 def initialize(filename) @filename = Pathname.new(filename) end |
Class Method Details
.new_from_filename(filename) ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/scissor/sound_file.rb', line 74 def self.new_from_filename(filename) ext = filename.extname.sub(/^\./, '').downcase unless klass = SUPPORTED_FORMATS[ext.to_sym] raise UnknownFormat end klass.new(filename) end |