-1

I'm simply tring play a wave/mp3 file from jruby.

Can you advice me what is the easiest library for ruby to do so in a multi-platform way ?

Since I'm using Jruby i think it would really make sense to use the java audio system, but I haven't found any tutorial on using that from Jruby.

So can you give me the quickest example of playing a wave file through java audio system ?

Thanks

Redoman
  • 3,059
  • 3
  • 34
  • 62

1 Answers1

1

just hacked one up: https://github.com/rdp/jruby-swing-helpers/blob/master/spec/play_mp3_audio.spec.rb

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
  • cool thanks, i have a few questions: 1) does it play only mp3's (not wavs) ? 2) why you commented it like this: `require File.dirname(__FILE__) + '/jl1.0.1.jar' # **third party jlayer mp3 jar **` - are you mad because you had to use a third party lib instead of managing to use java's internal libs? Anyway, thanks for giving me what i asked for! – Redoman Mar 21 '12 at 18:22
  • yes mad. yes only mp3's (there's another file called play_audio.rb that works with waves). So you were right on. – rogerdpack Mar 21 '12 at 21:23
  • why was not possible to use java internal libs if i can ask? Thanks – Redoman Mar 22 '12 at 23:14
  • basically the default jar's don't support it. You could plugin to them but http://stackoverflow.com/a/9791696/32453 "it isn't always compatible" apparently – rogerdpack Mar 22 '12 at 23:16