
com.harium.etyl.sound.model.Sound Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of etyl-gdx Show documentation
Show all versions of etyl-gdx Show documentation
An Etyl's backend based on libgdx
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 - 2025 Weber Informatics LLC | Privacy Policy