• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

BackgroundSound

The BackgroundSound node (Tables 15.33, 15.34, and 15.35) is similar to the PointSound node but does not have a location in space. The following code snippet illustrates how to use BackgroundSound to create ambient background music:

BackgroundSound bgsound = new BackgroundSound();
bgsound.setSoundData(
new MediaContainer("file:/j3d/bgsound.au"));
bgsound.setSchedulingBounds(soundBounds);
bgsound.setLoop(-1);
bgsound.setEnable(true);
bgsound.setInitialGain(0.25f);
body.addChild(bgsound);


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint