Example code on how to do background sounds is available as part of You Build
It VR:

http://havefun.ncsa.uiuc.edu/Java3D/YouBuildItVR/index.html

Look for the files LoopingSound.java and LoopingSoundBehavior.java

Steve

Tim Bray wrote:

> The SimpleSound demo that comes with J3d has a complex setup where the
> sound is enabled in a Behavior.  I just wanted a simple background hum,
> so did the following:
>
>     MediaContainer mc = new MediaContainer();
>     mc.setURL("url-of-my-.au-file");
>
>     BackgroundSound sound = new BackgroundSound();
>     sound.setLoop(0);
>     sound.setEnable(true);
>     sound.setSoundData(mc);
>     sound.setInitialGain(0.7f);
>     sound.setSchedulingBounds(box);  // bounds include where I am
>
>     myMainBranchGroup.addChild(sound);
>
> I don't hear anything.  I can run SimpleSound, so I know the machinery
> ought to work.  I can restructure my sound app to be in a behavior and
> do a byte-for-byte cut & paste out of SimpleSound which should get me
> some audio, but does anyone know what is missing from the above recipe?
>
> Among other things, I get the impression it's not even trying to read
> the .au file... -Tim
>
> ===========================================================================
> 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".

--
Steve Pietrowicz - [EMAIL PROTECTED]    Project Manager - NCSA Java 3D Group

NCSA Portfolio 1.3 beta 2:  http://havefun.ncsa.uiuc.edu/Java3D/portfolio/
   New Loaders, turn your Canvas3D into a JPEG, new InputDevices and more!
   Freely available for non-commercial use!

You Build It VR:     http://havefun.ncsa.uiuc.edu/Java3D/YouBuildItVR/
   Build your own multi-user virtual worlds with no programming experience!
The Java3D FAQ:      http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html

===========================================================================
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".

Reply via email to