Re: Opening instruments with appletviewer vs. browser
- From: "Momo" <mjeng@xxxxxxxxxxxxxxx>
- Date: 11 Feb 2007 13:25:17 -0800
On Jan 26, 8:09 pm, "Andrew Thompson" <andrewtho...@xxxxxxxxx> wrote:
On Jan 27, 5:04 am, "Momo" <m...@xxxxxxxxxxxxxxx> wrote:
A Java program that I've written that makes sounds works fine when I
test it with appletviewer, but not when I use a browser (Firefox or
Explorer). The difference is that when I call the MidiSystem
synthesizer with getAvailableInstruments, I get a bunch of instruments
(411) when running it with appletviewer, but none when using a browser.
Why the difference?
Quite possibly due to bugs in thesoundclasses.
There was a long discussion recently* about how
newer versions of Java showed different behaviour
for the same code.
If that is the case, you might try launching your
applet using web-start, to provide more control
over Java versioning.
* Either here or c.l.j.programmer.
Andrew T.
Thank you for the suggestion. It turned out not to work, but I got to
learn how to use WebStart, so that was good.
The solution to my problem turned out to be that I needed to install
the Java soundbank.
(at http://java.sun.com/products/java-media/sound/soundbanks.html )
Apparently even with the soundbank not installed, Java Sound can (on
Windows) make the sound by using a MIDI port for the sound. It will do
this when launched with appletviewer, but (apparently) not when
launched with a web browser or as an application. It seems that the
web browsers had security issues with letting the applet use a MIDI
port. (I'm still not totally sure why running it as an application
didn't work.)
My apologies for setting the follow-ups incorrectly. I believe that I
did in fact cross-post, rather than multi-posting, however?
Momo
.
- Follow-Ups:
- Re: Opening instruments with appletviewer vs. browser
- From: Andrew Thompson
- Re: Opening instruments with appletviewer vs. browser
- Prev by Date: Re: Design question
- Next by Date: Re: Opening instruments with appletviewer vs. browser
- Previous by thread: Help finishing excercise using JFrame, JPanel and General Advice
- Next by thread: Re: Opening instruments with appletviewer vs. browser
- Index(es):
Relevant Pages
|