Java Code Examples for org.lwjgl.openal.AL10#alGetSourcef()

The following examples show how to use org.lwjgl.openal.AL10#alGetSourcef() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpenALStreamPlayer.java    From opsu-dance with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Return the current playing position in the sound
 * 
 * @return The current position in seconds.
 */
public float getALPosition() {
	float playedTime = ((float) playedPos / (float) sampleSize) / sampleRate;
	float timePosition = playedTime + AL10.alGetSourcef(source, AL11.AL_SEC_OFFSET);
	return timePosition;
}
 
Example 2
Source File: OpenALStreamPlayer.java    From opsu with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Return the current playing position in the sound
 * 
 * @return The current position in seconds.
 */
public float getALPosition() {
	float playedTime = ((float) playedPos / (float) sampleSize) / sampleRate;
	float timePosition = playedTime + AL10.alGetSourcef(source, AL11.AL_SEC_OFFSET);
	return timePosition;
}
 
Example 3
Source File: AudioImpl.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * @see org.newdawn.slick.openal.Audio#getPosition()
 */
public float getPosition() {
	return AL10.alGetSourcef(store.getSource(index), AL11.AL_SEC_OFFSET);
}
 
Example 4
Source File: OpenALStreamPlayer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Return the current playing position in the sound
 * 
 * @return The current position in seconds.
 */
public float getPosition() {
	return positionOffset + AL10.alGetSourcef(source, AL11.AL_SEC_OFFSET);
}