use of io.xol.chunkstories.api.exceptions.SoundEffectNotFoundException in project chunkstories by Hugobros3.
the class ALSoundManager method playSoundEffect.
@Override
public SoundSource playSoundEffect(String soundEffect, Mode mode, Vector3dc position, float pitch, float gain, float attStart, float attEnd) {
try {
ALSoundSource ss;
if (mode == Mode.STREAMED)
ss = new ALBufferedSoundSource(soundEffect, position, pitch, gain, attStart, attEnd);
else
ss = new ALSoundSource(soundEffect, mode, position, pitch, gain, attStart, attEnd);
addSoundSource(ss);
return ss;
} catch (SoundEffectNotFoundException e) {
logger.warn("Sound not found " + soundEffect);
}
return new DummySoundSource();
}
use of io.xol.chunkstories.api.exceptions.SoundEffectNotFoundException in project chunkstories by Hugobros3.
the class ALSoundManager method replicateServerSoundSource.
@Override
public SoundSource replicateServerSoundSource(String soundName, Mode mode, Vector3dc position, float pitch, float gain, float attenuationStart, float attenuationEnd, long UUID) {
try {
ALSoundSource soundSource = null;
if (mode == Mode.STREAMED)
soundSource = new ALBufferedSoundSource(soundName, position, pitch, gain, attenuationStart, attenuationEnd);
else
soundSource = new ALSoundSource(soundName, mode, position, pitch, gain, attenuationStart, attenuationEnd);
// Match the UUIDs
soundSource.setUUID(UUID);
addSoundSource(soundSource);
return soundSource;
} catch (SoundEffectNotFoundException e) {
logger.warn("Sound not found " + soundName);
return null;
}
}
Aggregations