![]() |
![]() |
![]() |
![]() |
469 |
MediaContainer effect = new MediaContainer( "willow1.wav" );
Point2f[] front = new Point2f[. . .];
Point2f[] back = new Point2f[. . .];
Point3f[] atten = new Point3f[. . .];
. . .
TransformGroup group = new TransformGroup( );
. . .
ConeSound sound = new ConeSound( );
sound.setSoundData( effect );
sound.setInitialGain( 1.0f );
sound.setEnable( true );
sound.setLoop( -1 ); // Loop forever
sound.setPosition( new Point3f( 0.0f, 0.0f, 0.0f ) );
sound.setDirection( new Vector3f( 0.0f, 0.0f, 1.0f ) );
sound.setDistanceGain( front, back );
sound.setAngularAttenuation( atten );
. . .
sound.setSchedulingBounds( bounds );
group.addChild( sound );