Java Code Examples for org.newdawn.slick.openal.Audio#playAsSoundEffect()
The following examples show how to use
org.newdawn.slick.openal.Audio#playAsSoundEffect() .
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: AudioPlayer.java From FEMultiplayer with GNU General Public License v3.0 | 5 votes |
public static void playAudio(String name, float pitch, float gain, float x, float y, float z, float fade) { Audio audio = FEResources.getAudio(name); float cx, cy; if(camera == null) { cx = Game.getWindowWidth()/2; cy = Game.getWindowHeight()/2; } else { cx = camera.getX(); cy = camera.getY(); } audio.playAsSoundEffect(pitch, gain + globalGain, false, (x - cx) / fade, (y - cy) / fade, z); }
Example 2
Source File: AudioPlayer.java From FEMultiPlayer-V2 with GNU General Public License v3.0 | 4 votes |
/** * Play audio. * * @param name the name */ public static void playAudio(String name){ Audio audio = FEResources.getAudio(name); audio.playAsSoundEffect(1.0f, FEResources.getAudioVolume(), false); }
Example 3
Source File: AudioPlayer.java From FEMultiplayer with GNU General Public License v3.0 | 4 votes |
public static void playAudio(String name, float pitch, float gain) { Audio audio = FEResources.getAudio(name); audio.playAsSoundEffect(pitch, gain + globalGain, false); }