com.github.xpenatan.gdx.backends.teavm.DefaultTeaAudio Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of backend-teavm Show documentation
Show all versions of backend-teavm Show documentation
Tool to generate libgdx to javascript using teaVM
package com.github.xpenatan.gdx.backends.teavm;
import com.badlogic.gdx.audio.AudioDevice;
import com.badlogic.gdx.audio.AudioRecorder;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.github.xpenatan.gdx.backends.teavm.webaudio.howler.HowlerAudioManager;
/**
* @author xpenatan
* Port from GWT gdx 1.12.0
*/
public class DefaultTeaAudio implements TeaAudio {
private HowlerAudioManager webAudioAPIManager = null;
public DefaultTeaAudio() {
webAudioAPIManager = new HowlerAudioManager();
}
@Override
public AudioDevice newAudioDevice(int samplingRate, boolean isMono) {
throw new GdxRuntimeException("AudioDevice not supported by teaVM backend");
}
@Override
public AudioRecorder newAudioRecorder(int samplingRate, boolean isMono) {
throw new GdxRuntimeException("AudioRecorder not supported by teaVM backend");
}
@Override
public Sound newSound(FileHandle fileHandle) {
return webAudioAPIManager.createSound(fileHandle);
}
@Override
public Music newMusic(FileHandle file) {
return webAudioAPIManager.createMusic(file);
}
@Override
public boolean switchOutputDevice(String deviceIdentifier) {
return true;
}
@Override
public String[] getAvailableOutputDevices() {
return new String[0];
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy