diff options
Diffstat (limited to 'src/audio/audio.cc')
-rw-r--r-- | src/audio/audio.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/audio/audio.cc b/src/audio/audio.cc index 20f6b1d..8b65879 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -84,6 +84,9 @@ void play(const char *name) Buffers::bind(source, buffer); alSourcef(source, AL_PITCH, 1.0); alSourcef(source, AL_GAIN, 1.0); + alSourcei(source, AL_SOURCE_RELATIVE, AL_TRUE); + ALfloat location[] = {0.0f, 0.0f, 0.0f}; + alSourcefv(source, AL_POSITION, location); alSourceRewind(source); alSourcePlay(source); return; @@ -108,6 +111,8 @@ void loop( size_t source_index, const char *name, float pitch, float gain) ALuint source = Sources::source(source_index); Buffers::bind(source, Buffers::load(std::string(name))); + alSourcef(source, AL_REFERENCE_DISTANCE, 4.0f); + alSourcei(source, AL_SOURCE_RELATIVE, AL_FALSE); alSourcef(source, AL_PITCH, pitch); alSourcef(source, AL_GAIN, gain); |