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

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

Introduction

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

Prototype

public void stop();

Source Link

Document

Stops playing all instances of this sound.

Usage

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

License:Apache License

public static void stopSound(Sounds sound) {
    Sound soundSrc = Assets.soundMap.get(sound);
    soundSrc.stop();
}

From source file:com.mangecailloux.pebble.audio.SoundManager.java

License:Apache License

/**
 * Stop all instances of a sound./*from   w  ww .j  av  a2 s .  com*/
 * @param _key ID of the sound.
 */
public void stop(String _key) {
    Sound sound = get(_key);
    if (sound != null) {
        sound.stop();
    }
}

From source file:com.torrosoft.triviazo.services.music.SoundManager.java

License:Open Source License

@Override
public final void dispose() {
    for (final Sound sound : soundCache.retrieveAll()) {
        sound.stop();
        sound.dispose();/*from   w  w  w  .j  a  v a  2  s . c o m*/
    }
}

From source file:de.fgerbig.spacepeng.services.SoundManager.java

License:Apache License

/**
 * Disposes the sound manager./*from w  w  w  . ja v  a  2s  .c  o m*/
 */
public void dispose() {
    Gdx.app.log(Const.NAME, "Disposing sound manager");
    for (Sound sound : soundCache.retrieveAll()) {
        sound.stop();
        sound.dispose();
    }
}

From source file:dk.gruppeseks.bodtrd.managers.AudioPlayer.java

private void handleAudioTask(AssetManager am, AudioTask audioTask) {
    AudioAction audioAction = audioTask.getAudioAction();
    if (audioTask.getAudioType() == AudioType.SOUND) {

        Sound sound = am.get(audioTask.getFileName(), Sound.class);
        switch (audioAction) {
        case PLAY:
            sound.play();/*from  w  w w  .j  a v  a  2  s  . co  m*/
            break;
        case RESUME:
            sound.resume();
            break;
        case PAUSE:
            sound.pause();
            break;
        case STOP:
            sound.stop();
            break;
        case LOOP:
            sound.loop();
            break;
        case DISPOSE:
            sound.dispose();
            break;
        default:
            break;
        }
    } else {
        Music music = am.get(audioTask.getFileName(), Music.class);
        switch (audioAction) {
        case PLAY:
            music.play();
            break;
        case LOOP:
            music.play();
            music.setLooping(true);
            break;
        case PAUSE:
            music.pause();
            break;
        case STOP:
            music.stop();
            break;
        default:
            break;
        }
    }
}

From source file:net.k3rnel.unsealed.services.SoundManager.java

License:Open Source License

/**
 * Disposes the sound manager./*w  w w .  java2  s  . c  o m*/
 */
public void dispose() {
    Gdx.app.log(Unsealed.LOG, "Disposing sound manager");
    for (Sound sound : soundCache.retrieveAll()) {
        sound.stop();
        sound.dispose();
    }
}