From: Hans Fugal Date: 2006-07-27T09:45:04+09:00 Subject: Re: Generate a tone using ruby? Jeremiah Dodds wrote: > William James wrote: >> Jeremiah Dodds wrote: >>> Hey everyone, I'm looking for a simple way to generate a tone in ruby . >>> . any suggestions? >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >> print "\a" > > Well, yeah sure. What I'd like to be able to do is generate a tone of a > specific frequency. Like an A note, or a D sharp. > > I presume you want to play it out the speaker? I'm not sure if there's a portable way to do that, but in most unices it would be a matter of sending the audio data for that frequency to a special file, e.g. /dev/dsp. Or perhaps you want to save to a file. In either case, esp. the latter, ruby/audio would be worth a look. http://hans.fugal.net/src/ruby-audio/