Sha256: 54bc971ed594b08b08b271cd97f21e403b20b8747270e9eb5ed198aa09cc677c

Contents?: true

Size: 407 Bytes

Versions: 7

Compression:

Stored size: 407 Bytes

Contents

# Ruby2D::Sound

module Ruby2D
  class Sound

    attr_reader :path
    attr_accessor :data

    def initialize(path)
      unless File.exist? path
        raise Error, "Cannot find audio file `#{path}`"
      end
      @path = path
      unless ext_init(@path)
        raise Error, "Sound `#{@path}` cannot be created"
      end
    end

    # Play the sound
    def play
      ext_play
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby2d-0.9.5 lib/ruby2d/sound.rb
ruby2d-0.9.4 lib/ruby2d/sound.rb
ruby2d-0.9.3 lib/ruby2d/sound.rb
ruby2d-0.9.2 lib/ruby2d/sound.rb
ruby2d-0.9.1 lib/ruby2d/sound.rb
ruby2d-0.9.0 lib/ruby2d/sound.rb
ruby2d-0.8.1 lib/ruby2d/sound.rb