|
I'm still learning about sound,
myself. I've almost finished a nice demo for 3D sound that I'll post as a
tutorial, eventually.
I think your problem is that
MediaContainer takes a URL, not a filename.
Try: MediaContainer music
= MediaContainer("file:connected.wav")
Also, have you created your
AudioDevice?
Here's the fragment I use to start my
background sound:
private BranchGroup
createBackgroundSound()
{ 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:sounds/rain.wav"); rain.setCacheEnable(true); BackgroundSound bgs = new BackgroundSound(rain, 1.0f); bgs.setLoop(-1); bgs.setEnable(true); objGroup.addChild(bgs); return objGroup;
}
|
- [JAVA3D] Background Sound Patrik M�ller
- Re: [JAVA3D] Background Sound Corysia Taware
- Re: [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
