Hi,
We are trying to integrate sounds to our Java3D demo but
have problems with memory consumption and framerate drop.
Everything works quite well for a while, but after some time
the framerate drops down dramatically and the demo becomes almost
unplayable:-(
Some of our sounds, for example explosions are played quite often
and it seems like sound.setEnable(true) is reserving new memory
each time it is called. I have 256 MB memory in my Win2000
workstation and it should be enough... We use Java3D version
1.2.1 (OpenGL)
Has someone else had similar problems with point sound? I tried
to search messages in this mailing list but didn't find any
help...
------------------------------
Tapani Rauhala
�ximia software consulting Oy
[EMAIL PROTECTED]
Below is (simplified) source code we used:
public void startExplosion()
{
sound.setEnable(true);
}
public void init3D()
{
AudioDevice audioDev = universe.getViewer().createAudioDevice();
}
URL soundFile;
MediaContainer source;
public void loadSounds()
{
soundFile = new URL( m_applet.getCodeBase(), "explosion.wav");
source = new MediaContainer(soundFile);
PointSound sound = new PointSound(source, 1f, x, y, z);
//Then set necessary capabilities...
...
sound.setLoop(0);
sound.setEnable(false);
Point2f[] attenuation = new Point2f[3];
attenuation[0] = ...
sound.setDistanceGain(attenuation);
TransformGroup soundTG = new TransformGroup();
Transform3D soundTransform = new Transform3D();
...
soundTG.setTransform(soundTransform);
sound.setPosition(x, y, z);
BoundingSphere soundBounds =
new BoundingSphere(new Point3d(0f, 0f, 0f), 800.0);
sound.setSchedulingBounds(soundBounds);
soundTG.addChild(sound);
scene.addChild(soundTG);
}
===========================================================================
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".