Example usage for javax.media.j3d Sound setInitialGain

List of usage examples for javax.media.j3d Sound setInitialGain

Introduction

In this page you can find the example usage for javax.media.j3d Sound setInitialGain.

Prototype

public void setInitialGain(float amplitude) 

Source Link

Document

Set the overall gain scale factor applied to data associated with this source to increase or decrease its overall amplitude.

Usage

From source file:KeyNavigateTest.java

protected void setSoundAttributes(Sound sound, boolean bCollide) {
    sound.setCapability(Sound.ALLOW_ENABLE_WRITE);
    sound.setCapability(Sound.ALLOW_ENABLE_READ);

    sound.setSchedulingBounds(getSoundSchedulingBounds(bCollide));
    sound.setEnable(getSoundInitialEnable(bCollide));
    sound.setLoop(getSoundLoop(bCollide));
    sound.setPriority(getSoundPriority(bCollide));
    sound.setInitialGain(getSoundInitialGain(bCollide));

    sound.setContinuousEnable(getSoundContinuousEnable(bCollide));
    sound.setReleaseEnable(bCollide);//from  www.j a  v a  2s  .c o m

    if (sound instanceof PointSound) {
        PointSound pointSound = (PointSound) sound;
        pointSound.setInitialGain(getSoundInitialGain(bCollide));

        Point2f[] gainArray = getSoundDistanceGain(bCollide);

        if (gainArray != null)
            pointSound.setDistanceGain(gainArray);
    }
}