Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epoxy
GitHub Repository: epoxy/proj11
Path: blob/master/SLICK_HOME/src/org/newdawn/slick/openal/Audio.java
1461 views
1
package org.newdawn.slick.openal;
2
3
/**
4
* The description of of audio data loaded by the AudioLoader
5
*
6
* @author kevin
7
* @author Nathan Sweet <[email protected]>
8
*/
9
public interface Audio {
10
11
/**
12
* Stop the sound effect
13
*/
14
public void stop();
15
16
/**
17
* Get the ID of the OpenAL buffer holding this data (if any). This method
18
* is not valid with streaming resources.
19
*
20
* @return The ID of the OpenAL buffer holding this data
21
*/
22
public int getBufferID();
23
24
/**
25
* Check if the sound is playing as sound fx
26
*
27
* @return True if the sound is playing
28
*/
29
public boolean isPlaying();
30
31
/**
32
* Play this sound as a sound effect
33
*
34
* @param pitch The pitch of the play back
35
* @param gain The gain of the play back
36
* @param loop True if we should loop
37
* @return The ID of the source playing the sound
38
*/
39
public int playAsSoundEffect(float pitch, float gain, boolean loop);
40
41
/**
42
* Play this sound as a sound effect
43
*
44
* @param pitch The pitch of the play back
45
* @param gain The gain of the play back
46
* @param loop True if we should loop
47
* @param x The x position of the sound
48
* @param y The y position of the sound
49
* @param z The z position of the sound
50
* @return The ID of the source playing the sound
51
*/
52
public int playAsSoundEffect(float pitch, float gain, boolean loop,
53
float x, float y, float z);
54
55
/**
56
* Play this sound as music
57
*
58
* @param pitch The pitch of the play back
59
* @param gain The gain of the play back
60
* @param loop True if we should loop
61
* @return The ID of the source playing the sound
62
*/
63
public int playAsMusic(float pitch, float gain, boolean loop);
64
65
/**
66
* Seeks to a position in the music.
67
*
68
* @param position Position in seconds.
69
* @return True if the setting of the position was successful
70
*/
71
public boolean setPosition(float position);
72
73
/**
74
* Return the current playing position in the sound
75
*
76
* @return The current position in seconds.
77
*/
78
public float getPosition();
79
}
80
81