How to load/play an audio file?

HI Folks,

I’ve been trying to decipher the Java-to-Jruby for playing a sound file.
Yes, I’ve read https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
I’m also looking at
http://www3.ntu.edu.sg/home/ehchua/programming/java/J8c_PlayingSound.html

Could one of you “in the know” show me how to use SourceDataLine/Clip
or
JMF to load and play a sound file?

Thanks!
Peter F.
(847) 859-9550
Email: [email protected]
IM GTalk: peter.fitzgibbons
IM AOL: [email protected]

Here’s an example from Peter C.'s JRuby port of Markus Persson’s
“Prelude of the Chambered”:

https://github.com/peterc/potc-jruby/blob/master/escape/sound.rb

Does that help? Maybe it’s worth a wiki page somewhere…

  • Charlie

On Tue, Feb 14, 2012 at 4:01 AM, Peter F.

https://github.com/rdp/jruby-swing-helpers/blob/master/play_audio.rb

Is how I do it.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs