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

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

Introduction

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

Prototype

public long loop(float volume);

Source Link

Document

Plays the sound, looping.

Usage

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

License:Apache License

/**
 * Plays a given send effect/* w  w w . jav a2s  .  com*/
 * 
 * @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;
}