public void alSourcef(int source, int param, float value) { joalAl.alSourcef(source, param, value); }
/** * Sets the rolloff rate of the source. The default value is 1.0 * * @param rolloffFactor the rolloff rate of the source. */ public void setRolloffFactor(final float rolloffFactor) { al.alSourcef(sourceID, ALConstants.AL_ROLLOFF_FACTOR, rolloffFactor); }
/** * Sets the gain of the audio on this source. This can be used to contro * the volume of the source. * * @param gain the gain of the audio on this source */ public void setGain(final float gain) { al.alSourcef(sourceID, ALConstants.AL_GAIN, gain); }
/** * Sets the max distance where there will no longer be any attenuation of * the source. * * @param maxDistance the max ditance for source attentuation. */ public void setMaxDistance(final float maxDistance) { al.alSourcef(sourceID, ALConstants.AL_MAX_DISTANCE, maxDistance); }
/** * Sets the minimum gain for this source. * * @param minGain the minimum gain for this source. */ public void setMinGain(final float minGain) { al.alSourcef(sourceID, ALConstants.AL_MIN_GAIN, minGain); }
/** * Sets the maximum gain for this source. * * @param maxGain the maximum gain for this source */ public void setMaxGain(final float maxGain) { al.alSourcef(sourceID, ALConstants.AL_MAX_GAIN, maxGain); }
/** * Sets the pitch of the audio on this source. The pitch may be modified * without altering the playback speed of the audio. * * @param pitch the pitch value of this source. */ public void setPitch(final float pitch) { al.alSourcef(sourceID, ALConstants.AL_PITCH, pitch); }
/** * Sets the distance under which the volume for the source would normally * drop by half, before being influenced by rolloff factor or max distance. * * @param referenceDistance the reference distance for the source. */ public void setReferenceDistance(final float referenceDistance) { al.alSourcef(sourceID, ALConstants.AL_REFERENCE_DISTANCE, referenceDistance); }
/** * Sets the gain when outside the oriented cone. * * @param coneOuterGain the gain when outside the oriented cone. */ public void setConeOuterGain(final float coneOuterGain) { al.alSourcef(sourceID, ALConstants.AL_CONE_OUTER_GAIN, coneOuterGain); }
public void alSourcef(int source, int param, float value) { joalAl.alSourcef(source, param, value); }
@Override public final boolean setVolume(float v) { if( !initialized || null == chosenFormat ) { return false; } lockContext(); try { if( Math.abs(v) < 0.01f ) { v = 0.0f; } else if( Math.abs(1.0f - v) < 0.01f ) { v = 1.0f; } if( 0.0f <= v && v <= 1.0f ) { // OpenAL limits volume = v; al.alSourcef(alSource[0], ALConstants.AL_GAIN, v); return true; } } finally { unlockContext(); } return false; }
@Override public final boolean setPlaySpeed(float rate) { if( !initialized || null == chosenFormat ) { return false; } lockContext(); try { if( Math.abs(1.0f - rate) < 0.01f ) { rate = 1.0f; } if( 0.5f <= rate && rate <= 2.0f ) { // OpenAL limits playSpeed = rate; al.alSourcef(alSource[0], ALConstants.AL_PITCH, playSpeed); return true; } } finally { unlockContext(); } return false; }
@Override public final boolean setVolume(float v) { if( !initialized || null == chosenFormat ) { return false; } lockContext(); try { if( Math.abs(v) < 0.01f ) { v = 0.0f; } else if( Math.abs(1.0f - v) < 0.01f ) { v = 1.0f; } if( 0.0f <= v && v <= 1.0f ) { // OpenAL limits volume = v; al.alSourcef(alSource[0], ALConstants.AL_GAIN, v); return true; } } finally { unlockContext(); } return false; }
@Override public final boolean setPlaySpeed(float rate) { if( !initialized || null == chosenFormat ) { return false; } lockContext(); try { if( Math.abs(1.0f - rate) < 0.01f ) { rate = 1.0f; } if( 0.5f <= rate && rate <= 2.0f ) { // OpenAL limits playSpeed = rate; al.alSourcef(alSource[0], ALConstants.AL_PITCH, playSpeed); return true; } } finally { unlockContext(); } return false; }