Created
October 11, 2011 14:27
-
-
Save koyachi/1278218 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'coreaudio' | |
dev = CoreAudio.default_output_device | |
buf = dev.output_loop(44000) | |
line = ARGV[0] | |
puts line | |
44000.times do |t| | |
# buf[i] = 0x3FFF * rand() | |
# buf[i] = t * ((t >> 9 | t >> 13) & 25 & t >> 6) | |
buf[t] = eval line | |
end | |
buf.start | |
sleep 10 | |
buf.stop | |
__END__ | |
SYNOPSIS: | |
% ruby _dev_audio.rb 't * ((t >> 9 | t >> 13) & 25 & t >> 6)' | |
SEE ALSO: | |
http://d.hatena.ne.jp/miujun/20111003 | |
https://github.com/nagachika/ruby-coreaudio/blob/master/examples/outloop_sine.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment