Search in sources :

Example 1 with DummySoundSource

use of io.xol.chunkstories.sound.source.DummySoundSource 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();
}
Also used : DummySoundSource(io.xol.chunkstories.sound.source.DummySoundSource) ALSoundSource(io.xol.chunkstories.sound.source.ALSoundSource) SoundEffectNotFoundException(io.xol.chunkstories.api.exceptions.SoundEffectNotFoundException) ALBufferedSoundSource(io.xol.chunkstories.sound.source.ALBufferedSoundSource)

Aggregations

SoundEffectNotFoundException (io.xol.chunkstories.api.exceptions.SoundEffectNotFoundException)1 ALBufferedSoundSource (io.xol.chunkstories.sound.source.ALBufferedSoundSource)1 ALSoundSource (io.xol.chunkstories.sound.source.ALSoundSource)1 DummySoundSource (io.xol.chunkstories.sound.source.DummySoundSource)1