572

Adding sound
PointSound example code

  • Create a sound
    PointSound mySound = new PointSound( );
    mySound.setSoundData( myWave );
    mySound.setEnable( true );
    mySound.setInitialGain( 1.0f );
    mySound.setLoop( -1 );  // Loop forever
    mySound.setPosition( new Point3f( 0.0f, 1.0f, 0.0f ) );
    mySound.setDistanceGain( myAtten );

  • Set the scheduling bounds
    BoundingSphere myBounds = new BoundingSphere(
        new Point3d( ), 1000.0 );
    mySound.setSchedulingBounds( myBounds );