How to play a wav file in Ruby?

守給你的承諾、 提交于 2019-12-23 20:03:55

问题


What is a good way to play an audio file from Ruby that is wav format?

OSX or Ubuntu...

Ruby 1.9.3


回答1:


I've used Gosu to play audio in a simple game context, so I imagine it would work fine for you...

@tune = Gosu::Song.new(window, "tune.wav")
@tune.play(true)


来源:https://stackoverflow.com/questions/14993412/how-to-play-a-wav-file-in-ruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!