I didn't mean to suggest you should change your variable name for your
simple universe. I was just pointing out that I use a different name.
Did you add a Soundscape? Like this:
Soundscape soundScape2 = new Soundscape();
AuralAttributes attributes2 = new AuralAttributes();
attributes2.setReverbOrder(6);
attributes2.setCapability(AuralAttributes.ALLOW_REVERB_ORDER_WRITE);
attributes2.setCapability(AuralAttributes.ALLOW_REVERB_DELAY_WRITE);
attributes2.setCapability(AuralAttributes.ALLOW_REFLECTION_COEFFICIENT_WRITE);
soundScape2.setApplicationBounds(bounds);
soundScape2.setAuralAttributes(attributes2);
objRoot.addChild(soundScape2);
- John Wright
Starfire Research
sreelatha menon wrote:
>
> Thanks. I tried adding AudioDevice. No use. As you suggested I tried changing
> the variable name. I think in Sound programs that doen't work. Thanks anyway.
>
> Sreelatha
>
> John Wright <[EMAIL PROTECTED]> wrote:
> Try adding:
>
> AudioDevice audioDev = simpleU.getViewer().createAudioDevice();
>
> (Looks like you are using "u" instead of "simpleU" as your
> SimpleUniverse variable.)
>
> - John Wright
> Starfire Research
>
> sreelatha menon wrote:
> >
> > I'm trying to play a background sound file with a Canvas animating some
> > graphics. It doesn't play the sound. Does anyone know what else I need to
> add
> > to the following code? Any help will be appreciated.
> >
> > public void init()
> > {
> > GraphicsConfiguration config =
> > SimpleUniverse.getPreferredConfiguration();
> > MyCanvas3D c = new MyCanvas3D(config);
> >
> > setLayout(new BorderLayout());
> > add("Center", c);
> >
> > BranchGroup scene = createSceneGraph();
> > SimpleUniverse u = new SimpleUniverse(c);
> >
> > u.getViewingPlatform().setNominalViewingTransform();
> > u.addBranchGraph(scene);
> > }
> >
> > private BranchGroup createSceneGraph() {
> >
> > BranchGroup objRoot = new BranchGroup();
> >
> > TransformGroup objTrans = new TransformGroup();
> >
> objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
> > objRoot.addChild(objTrans);
> >
> > BoundingSphere bounds = new BoundingSphere(new
> Point3d(0.0,0.0,0.0),
> > 100.0);
> >
> > try
> > {
> >
> > MediaContainer sample = new MediaContainer(new
> > URL("file:bgm.au"));
> > sample.setCapability(MediaContainer.ALLOW_URL_WRITE);
> >
> sample.setCapability(MediaContainer.ALLOW_URL_READ);
> > sample.setCacheEnable(false);
> > sound = new BackgroundSound(sample, 2.0F);
> > sound.setLoop(1);
> > sound.setContinuousEnable(true);
> >
> > sound.setReleaseEnable(true);
> > 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);
> >
> sound.setCapability(PointSound.ALLOW_IS_READY_READ);
> >
> > sound.setEnable(true);
> >
> > BoundingSphere soundBounds
> = new BoundingSphere(new
> > Point3d(0.0,0.0,0.0), 500.0);
> > sound.setSchedulingBounds(soundBounds);
> > objTrans.addChild(sound);
> >
> > objRoot.compile();
> >
> > }
> > catch (MalformedURLException ex)
> > {
> > System.out.println("MalformedURL");
> > }
> >
> > return objRoot;
> > }
> >
> > ____________________________________________________________________
> > Get free email and a permanent address at http://www.netaddress.com/?N=1
> >
> > ===========================================================================
> > 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".
>
> ===========================================================================
> 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".
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
>
> ===========================================================================
> 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".
===========================================================================
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".