From: Jim McKerchar Date: 2010-10-23T07:56:23+09:00 Subject: Re: How can I play sound using ruby? --------------070104080300020000000306 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 18/10/2010 23:41, Ted Flethuseo wrote: > I want to build a program where I will need to play sound from a wav > file using ruby. Is this platform dependent? I will need this for > windows. > > I tried the following: > > ruby-sound.rb > > require 'win32/sound' > include Win32 > Sound.play('chimes.wav') > Sound.play('c:\sounds\hal9000.wav') > > http://rubyonwindows.blogspot.com/2007/05/adding-sound-to-your-ruby-apps.html > > but I get the following errors: > > ruby ruby-sound.rb > > :29:in `require': 126: The > specified modul > e could not be found. - > C:/Ruby192/lib/ruby/gems/1.9.1/gems/win32-api-1.4.6-x8 > 6-mingw32/lib/win32/api.so (LoadError) > from:29:in `require' > from > C:/Ruby192/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/a > pi.rb:1:in `' > from:29:in `require' > from:29:in `require' > from > C:/Ruby192/lib/ruby/gems/1.9.1/gems/windows-pr-1.0.9/lib/windows/so > und.rb:1:in `' > from:29:in `require' > from:29:in `require' > from > C:/Ruby192/lib/ruby/gems/1.9.1/gems/win32-sound-0.4.2/lib/win32/sou > nd.rb:1:in `' > from:33:in `require' > from:33:in `rescue in > require' > from:29:in `require' > from ruby-sound.rb:1:in `
' > > > Ted. > > > > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.862 / Virus Database: 271.1.1/3212 - Release Date: 10/22/10 07:34:00 > > Have you installed the win32-api gem? Jim --------------070104080300020000000306--