Hi All,
    Has anybody got an example on using sounds in java3d.I refered java3d's SimpleSounds example..But they are using Behaviors for Sound...Is it necessary to use Behaviors for Sound.
 
So i created a behavior class & in that behavior...i'm getting the reference of this sound object & seting the setEnable(true)....but i din't hear any sound...instaed of that i'm getting a error message.
 
Can anybody tell me wat's wrong with this code
 
Thanks in adavnce
Ravi
 
When i tried doing something like this.
 
BackGround sound=new BackgroundSound();
 sound.setCapability(PointSound.ALLOW_ENABLE_WRITE);
 sound.setCapability(PointSound.ALLOW_INITIAL_GAIN_WRITE);
 sound.setCapability(PointSound.ALLOW_SOUND_DATA_WRITE);
 sound.setCapability(PointSound.ALLOW_SCHEDULING_BOUNDS_WRITE);
 sound.setCapability(PointSound.ALLOW_CONT_PLAY_WRITE);
 sound.setCapability(PointSound.ALLOW_RELEASE_WRITE);
 sound.setCapability(PointSound.ALLOW_DURATION_READ);
 sound.setCapability(PointSound.ALLOW_IS_PLAYING_READ);
 sound.setCapability(PointSound.ALLOW_LOOP_WRITE);
 
 MediaContainer sample1 = new MediaContainer();
 sample1.setCapability(MediaContainer.ALLOW_URL_WRITE);
 sample1.setCapability(MediaContainer.ALLOW_URL_READ);
 try
 {
  sample1.setURLString("roar.au");
 }
 catch (Exception e)
 {
  System.out.println("Exception in locating the Wave File...");
 }
 sample1.setCacheEnable(false);
 sound.setLoop(0);
 sound.setContinuousEnable(false);
 sound.setReleaseEnable(false);
 sound.setSoundData(sample1);
 sound.setInitialGain(0.7f);
 sound.setSchedulingBounds(new BoundingSphere());
 
 transfromGroup.addChild(sound);
 
and in the initialize() i did the following
 
simpleUniverse = new SimpleUniverse(canvas3D);
AudioDevice audioDev = simpleUniverse.getViewer().createAudioDevice();
 audioDev.initialize();
 
 
But the i got the following error
J3dI18N: Error looking up: SoundRetained1
javax.media.j3d.SoundException: roar.au: SoundRetained1

Reply via email to