Simple sound manager for OpenAL using n sources accessed in a round robin schedule. Source n is reserved for a single buffer and checking for whether it's playing.
| Modifier and Type | Field and Description |
|---|---|
| private int | bufferIndex
Current index in our buffers |
| private int[] | buffers
We support at most 256 buffers |
| private IntBuffer | scratchBuffer
Our internal scratch buffer |
| private boolean | soundOutput
Whether we're running in no sound mode |
| private int | sourceIndex
Current index in our source list |
| private int[] | sources
Number of sources is limited tby user (and hardware) |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public void | |
| public void | |
| public boolean | Returns: true if a source is playing right now on source nWhether a sound is playing on last source |
| public void | |
| public void |
| bufferIndex | back to summary |
|---|---|
| private int bufferIndex Current index in our buffers | |
| buffers | back to summary |
|---|---|
| private int[] buffers We support at most 256 buffers | |
| scratchBuffer | back to summary |
|---|---|
| private IntBuffer scratchBuffer Our internal scratch buffer | |
| soundOutput | back to summary |
|---|---|
| private boolean soundOutput Whether we're running in no sound mode | |
| sourceIndex | back to summary |
|---|---|
| private int sourceIndex Current index in our source list | |
| sources | back to summary |
|---|---|
| private int[] sources Number of sources is limited tby user (and hardware) | |
| SoundManager | back to summary |
|---|---|
| public SoundManager() Creates a new SoundManager | |
| addSound | back to summary |
|---|---|
| public int addSound(String path) Adds a sound to the Sound Managers pool
| |
| destroy | back to summary |
|---|---|
| public void destroy() Destroy this SoundManager | |
| initialize | back to summary |
|---|---|
| public void initialize(int channels) Initializes the SoundManager
| |
| isPlayingSound | back to summary |
|---|---|
| public boolean isPlayingSound() Whether a sound is playing on last source
| |
| playEffect | back to summary |
|---|---|
| public void playEffect(int buffer) Plays a sound effect
| |
| playSound | back to summary |
|---|---|
| public void playSound(int buffer) Plays a sound on last source
| |