views:

55

answers:

3
+1  Q: 

Soundbank for Java

I am working on a Java applet that uses javax.sound.midi.sequencer to play a MIDI sequence. In order for this to work, the visitor needs to have a soundbank installed on his/her computer. Apparently, the Windows JRE doesn't come with a soundbank, and one has to be downloaded separately from http://java.sun.com/products/java-media/sound/soundbanks.html . However, it is possible to load a soundbank from a file without having to go through the installation process. So, that brings me to my question: does anyone know where I can find a redistributable (open source) JavaSound-compatible soundbank? Alternatively, is there any way that I can legally redistribute Sun's soundbanks from the URL above, without redistributing the entire JRE? I want to have a soundbank that my applet can load on-the-fly from a file.

A: 

I looked on the Oracle website you linked, and I don't see why you can't include a soundbank.gm file as part of your applet.

I think adding a copyright notice somewhere in your applet would meet the terms of the license.

Soundbank is copyright © 2008, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.

If you want to be on the safe side, contact Oracle and ask them.

Gilbert Le Blanc
Thanks for the link... I'll probably try to contact Oracle about this.
Jonathan
A: 

The page you linked to claims to fall back to the hardware MIDI port if a soundbank doesn't exist.

I guess a better question is... have you tried using it without a Soundbank?

Incidentally, most browsers can play MIDI files just fine, so I'm not sure why you'd need an Applet to do this, unless it's background sound for something else.

R. Bemrose
Yes, I have tried using it without a soundbank. When no soundbank is installed and I call MidiSystem.getSynthesizer().getAvailableInstruments(), I get a zero-length array. My application needs to get the available instruments, and it can't do so if there is no soundbank. The reason that I'm using an applet to play this MIDI is because the applet actually generates the MIDI data on the fly (it isn't just playing a MIDI file).
Jonathan
A: 

Both the JDK README and the JRE README contain a redistribution section that addresses soundbanks:

...the JDK's soundbank.gm file may be included in redistributions of the JRE at the vendor's discretion. Several versions of enhanced MIDI soundbanks are available from the Java Sound web site: http://java.sun.com/products/java-media/sound/. These alternative soundbanks may be included in redistributions of the JRE.

Which makes it sound like they can be redistributed but only as part of a JRE...

kschneid
Yes, I noticed that section as well. However, I wasn't sure whether this implies that the soundbank can't be redistributed separately... I think that it only gives permission to modify the JRE/JDK redistributable to include the soundbank file.
Jonathan