List of usage examples for javax.media.j3d BackgroundSound setSchedulingBounds
public void setSchedulingBounds(Bounds region)
From source file:SimpleSounds.java
/** * This adds a continuous background sound to the branch group. * //from www . j ava 2 s.co m * @param b * BranchGroup to add the sound to. * @param soundFile * String that is the name of the sound file. */ protected void addBackgroundSound(BranchGroup b, String soundFile) { //Create a media container to load the file MediaContainer droneContainer = new MediaContainer(soundFile); //Create the background sound from the media container BackgroundSound drone = new BackgroundSound(droneContainer, 1.0f); //Activate the sound drone.setSchedulingBounds(bounds); drone.setEnable(true); //Set the sound to loop forever drone.setLoop(BackgroundSound.INFINITE_LOOPS); //Add it to the group b.addChild(drone); }