All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.harium.etyl.sound.model.Sound Maven / Gradle / Ivy

The newest version!
package com.harium.etyl.sound.model;

import com.harium.etyl.loader.MultimediaLoader;
import com.harium.etyl.loader.async.AsyncResource;

public class Sound implements AsyncResource {

    private com.badlogic.gdx.audio.Sound sound;

    public Sound(String path) {
        MultimediaLoader.getInstance().loadSoundAsync(path, this);
    }

    public void play() {
        if (sound == null) {
            return;
        }
        sound.play();
    }

    @Override
    public void onLoad(com.badlogic.gdx.audio.Sound sound) {
        this.sound = sound;
    }

    @Override
    public Class resourceClass() {
        return com.badlogic.gdx.audio.Sound.class;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy