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

com.jtransc.game.audio.Sound Maven / Gradle / Ivy

Go to download

JVM AOT compiler currently generating Javascript and Haxe, with initial focus on Kotlin and games.

There is a newer version: 0.5.0
Show newest version
package com.jtransc.game.audio;

import com.jtransc.media.JTranscAudio;

/**
 * Use JTranscGame.sound() to create a sound
 */
public class Sound {
	private int id;

	public Sound(String path) {
		id = JTranscAudio.createSound(path);
	}

	public void dispose() {
		if (id < 0) return;
		JTranscAudio.disposeSound(id);
		id = -1;
	}

	public void play() {
		JTranscAudio.playSound(id);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy