A
Andy Korth
Greetings,
I'm interesting in writing a small ruby script that will play a wav
file. I'm using
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
I haven't found anything other than what seems to be a windows only
solution:
http://rubyonwindows.blogspot.com/2007/05/adding-sound-to-your-ruby-apps.html
I've tried invoking applications that would play a sound through the
system command, but none of them have worked very well.
Here's my code thus far:
Dir.glob("*.{WAV,wav}") do |sound|
puts "Playing #{sound}, (n)ext or return to replay"
case readline.strip
when '':
system("playsound " + sound)
redo
when 'n'
next
when 'q'
exit
else
redo
end
end
Thank you very much for your time,
Andy
I'm interesting in writing a small ruby script that will play a wav
file. I'm using
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
I haven't found anything other than what seems to be a windows only
solution:
http://rubyonwindows.blogspot.com/2007/05/adding-sound-to-your-ruby-apps.html
I've tried invoking applications that would play a sound through the
system command, but none of them have worked very well.
Here's my code thus far:
Dir.glob("*.{WAV,wav}") do |sound|
puts "Playing #{sound}, (n)ext or return to replay"
case readline.strip
when '':
system("playsound " + sound)
redo
when 'n'
next
when 'q'
exit
else
redo
end
end
Thank you very much for your time,
Andy