Sha256: e25e7edba8edfa27de6b60c04c2fab3f333de8829ee71e36db6dd57ea8de3369
Contents?: true
Size: 236 Bytes
Versions: 12
Compression:
Stored size: 236 Bytes
Contents
require "coreaudio" dev = CoreAudio.default_output_device buf = dev.output_loop(44000) phase = Math::PI * 2.0 * 440.0 / 44000.0 44000.times do |i| buf[i] = ((0.4 * Math.sin(phase*i)) * 0x7FFF).round end buf.start sleep 2 buf.stop
Version data entries
12 entries across 12 versions & 1 rubygems