Example usage for com.badlogic.gdx.audio Sound play

List of usage examples for com.badlogic.gdx.audio Sound play

Introduction

In this page you can find the example usage for com.badlogic.gdx.audio Sound play.

Prototype

public long play(float volume);

Source Link

Document

Plays the sound.

Usage

From source file:app.badlogicgames.superjumper.Assets.java

License:Apache License

public static void playSound(Sound sound) {
    if (Settings.soundEnabled)
        sound.play(1);
}

From source file:com.agateau.pixelwheels.sound.DefaultAudioManager.java

License:Open Source License

@Override
public void play(Sound sound, float volume) {
    if (mMuted) {
        return;/*from  w w  w.j a  va 2s. c  o m*/
    }
    sound.play(volume);
}

From source file:com.andgate.ikou.model.Player.java

License:Open Source License

private boolean slideStopGradually(float delta, Sound soundEffect) {
    if (!slideStarted) {
        if (soundEffect != null) {
            soundEffect.play(0.2f);
        }/*from w w w . jav  a 2 s .  c o m*/

        slideRoughTween.setup(initialPosition, finalPosition, SLIDE_SPEED, ROUGH_SLIDE_DECCELERATION);
        slideStarted = true;
    }

    boolean isSlidingOver = slideRoughTween.update(delta);
    position.set(slideRoughTween.get());

    if (isSlidingOver) {
        slideStarted = false;
        direction.set(0, 0, 0);

        initialPosition.set(position);
    }

    return isSlidingOver;
}

From source file:com.android.ringfly.common.Assets.java

License:Apache License

public static void playSound(Sounds sound, Boolean loop, float volume) {
    Sound soundSrc = Assets.soundMap.get(sound);
    if (ConfigSet.userMap.get("0").getSound()) {
        if (loop)
            soundSrc.loop();//from w w  w .  j a va 2s . c om
        else
            soundSrc.play(volume);
    }
}

From source file:com.android.ringfly.common.Assets.java

License:Apache License

public static void playSound(Sounds sound) {
    Sound soundSrc = Assets.soundMap.get(sound);
    if (ConfigSet.userMap.get("0").getSound()) {
        soundSrc.play(1);
    }/*from   ww w  .j  a  v  a2 s .  c  o  m*/
}

From source file:com.badlydrawngames.veryangryrobots.Assets.java

License:Apache License

public static void playSound(Sound sound) {
    sound.play(1);
}

From source file:com.bagon.matchteam.mtx.managers.AudioManager.java

License:Apache License

/**
 * Play sound effect, it only plays if SettingsManager.isSoundOn() is true
 * /*  w w  w  .j av a2s .c om*/
 * @param sound
 *            to play
 * @param volume
 *            is the volume setting (Range [0.0 - 1.0])
 * @see SettingsManager.isSoundOn
 * 
 * */
public void playSound(Sound sound, float volume) {
    if (SettingsManager.isSoundOn()) {
        sound.play(volume);
    }
}

From source file:com.bss.game.Assets.java

License:Apache License

public static void playSound(Sound sound) {
    if (getSound())
        sound.play(1);
}

From source file:com.jumpbuttonstudios.vikingdodge.SoundManager.java

License:Apache License

/**
 * Plays a given send effect/*from   www .ja v a2s .  c  om*/
 * 
 * @param effect
 * @param volume
 * @return the sound ID
 */
public long playSound(Sound effect, float volume) {
    return effect.play(volume);
}

From source file:com.jumpbuttonstudios.vikingdodge.SoundManager.java

License:Apache License

/**
 * Plays a given send effect// w  ww.ja  v  a 2 s. c  o  m
 * 
 * @param effect
 * @param volume
 * @return the sound ID
 */
public long playSound(Sound effect, float volume, boolean loop) {
    long id = effect.play(volume);
    if (soundIDs.contains(id, false)) {
        effect.stop(id);
        soundIDs.removeValue(id, false);
    }
    effect.loop(id);
    soundIDs.add(id);
    return id;
}