Sha256: 65c68f0e82920fe326e81cf83227e330fe6693b6f7944ef06aa07e2f3fbd8b31

Contents?: true

Size: 359 Bytes

Versions: 3

Compression:

Stored size: 359 Bytes

Contents

# sound.rb

module Ruby2D
  class Sound

    attr_accessor :data
    attr_reader :path

    def initialize(path)

      unless RUBY_ENGINE == 'opal'
        unless File.exists? path
          raise Error, "Cannot find audio file `#{path}`"
        end
      end

      @path = path
      ext_init(path)
    end

    def play
      ext_play
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby2d-0.5.1 lib/ruby2d/sound.rb
ruby2d-0.5.0 lib/ruby2d/sound.rb
ruby2d-0.4.2 lib/ruby2d/sound.rb