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

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

Introduction

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

Prototype

public void setLooping(long soundId, boolean looping);

Source Link

Document

Sets the sound instance with the given id to be looping.

Usage

From source file:com.mygdx.game.AudioPlayer.java

public long playSfx(String key, boolean looping, float vol) {
    Sound s = sfx.get(key);
    long myID = s.play(vol * sfxVolume);
    s.setLooping(myID, looping);
    return myID;//from  w w w.  j  av a  2s.  c  o m
}