I'm trying to make a simple background sound work...here is the code:
PhysicalEnvironment pe = tgCamera.getPhysicalEnvironment();
audioDevice = new AudioEngine(pe);
try {
soundURL = new URL("file:roar.au");
System.out.println("soundURL: "+soundURL);
} catch(MalformedURLException mue) {
mue.printStackTrace();
}
if(soundURL!=null) {
soundMC = new MediaContainer(soundURL);
BackgroundSound soundBg = new BackgroundSound();
soundBg.setSchedulingBounds(bounds);
soundBg.setSoundData(soundMC);
//soundBg.setLoop(Sound.INFINITE_LOOPS);
//soundBg.setEnable(true);
//soundBg.setCapability(Sound.ALLOW_STATE_WRITE);
addChild(soundBg);
}
It seems to be bombing out at:
soundBg.setSoundData(soundMC);
with the following Exception:
java.lang.ClassCastException: com.sun.j3d.audioengines.AudioEngine
at
javax.media.j3d.SoundScheduler.checkAudioDevice3D(SoundScheduler.java
:2566)
at
javax.media.j3d.SoundScheduler.attachSoundData(SoundScheduler.java:26
12)
at
javax.media.j3d.SoundScheduler.processSoundAtom(SoundScheduler.java:1
285)
at
javax.media.j3d.SoundScheduler.calcSchedulingAction(SoundScheduler.ja
va:1577)
at
javax.media.j3d.SoundScheduler.renderChanges(SoundScheduler.java:787)
at
javax.media.j3d.SoundScheduler.processMessages(SoundScheduler.java:22
9)
at
javax.media.j3d.StructureUpdateThread.doWork(StructureUpdateThread.ja
va:83)
at javax.media.j3d.J3dThread.run(J3dThread.java:256)
Any ideas?
thanks,
Mike
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".