|
Whoops, I posted the wrong version.
The code below won't work because the bounding sphere is missing.
This is the correct version:
private BranchGroup
createBackgrounSound()
{ BranchGroup objGroup = new BranchGroup(); AudioDevice audioDev = u.getViewer().createAudioDevice(); if (!audioDev.initialize()) { System.out.println("Failed to init audio device, exiting!"); System.exit(1); } MediaContainer rain = new MediaContainer("file:rain.wav"); rain.setCacheEnable(true); BackgroundSound bgs = new BackgroundSound(rain, 1.0f); BoundingSphere soundBounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); bgs.setSchedulingBounds(soundBounds); bgs.setLoop(-1); bgs.setEnable(true); objGroup.addChild(bgs); return objGroup;
}
|
- [JAVA3D] Background Sound Patrik M�ller
- Re: [JAVA3D] Background Sound Corysia Taware
- [JAVA3D] Background Sound Corysia Taware
- [JAVA3D] Background Sound Patrik M�ller
- Re: [JAVA3D] Background Sound Corysia Taware
- [JAVA3D] background sound David Yazel
- Re: [JAVA3D] background sound Chien Yang
