diff --git a/src/sound/backend/i_sound.cpp b/src/sound/backend/i_sound.cpp index 2e22090b3..cdfa288c3 100644 --- a/src/sound/backend/i_sound.cpp +++ b/src/sound/backend/i_sound.cpp @@ -487,10 +487,3 @@ SoundHandle SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int length) if (data) delete[] data; return retval; } - -SoundHandle SoundRenderer::LoadSoundBuffered(FSoundLoadBuffer *buffer) -{ - SoundHandle retval = { NULL }; - return retval; -} - diff --git a/src/sound/backend/i_sound.h b/src/sound/backend/i_sound.h index 0155d620e..603714900 100644 --- a/src/sound/backend/i_sound.h +++ b/src/sound/backend/i_sound.h @@ -110,7 +110,6 @@ public: virtual SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *pBuffer = nullptr) = 0; SoundHandle LoadSoundVoc(uint8_t *sfxdata, int length); virtual SoundHandle LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1) = 0; - virtual SoundHandle LoadSoundBuffered(FSoundLoadBuffer *buffer); virtual void UnloadSound (SoundHandle sfx) = 0; // unloads a sound from memory virtual unsigned int GetMSLength(SoundHandle sfx) = 0; // Gets the length of a sound at its default frequency virtual unsigned int GetSampleLength(SoundHandle sfx) = 0; // Gets the length of a sound at its default frequency diff --git a/src/sound/backend/oalsound.cpp b/src/sound/backend/oalsound.cpp index 4415d9ce0..4fc0ccad7 100644 --- a/src/sound/backend/oalsound.cpp +++ b/src/sound/backend/oalsound.cpp @@ -1134,60 +1134,6 @@ SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length, FSoundL return retval; } -SoundHandle OpenALSoundRenderer::LoadSoundBuffered(FSoundLoadBuffer *pBuffer) -{ - SoundHandle retval = { NULL }; - ALenum format = AL_NONE; - int srate = pBuffer->srate; - auto type = pBuffer->type; - auto chans = pBuffer->chans; - uint32_t loop_start = pBuffer->loop_start, loop_end = pBuffer->loop_end; - - if (chans == ChannelConfig_Mono) - { - if (type == SampleType_UInt8) format = AL_FORMAT_MONO8; - if (type == SampleType_Int16) format = AL_FORMAT_MONO16; - } - else if (chans == ChannelConfig_Stereo) - { - if (type == SampleType_UInt8) format = AL_FORMAT_STEREO8; - if (type == SampleType_Int16) format = AL_FORMAT_STEREO16; - } - - if (format == AL_NONE) - { - Printf("Unsupported audio format: %s, %s\n", GetChannelConfigName(chans), - GetSampleTypeName(type)); - return retval; - } - - auto &data = pBuffer->mBuffer; - - ALenum err; - ALuint buffer = 0; - alGenBuffers(1, &buffer); - alBufferData(buffer, format, &data[0], (ALsizei)data.size(), srate); - if ((err = getALError()) != AL_NO_ERROR) - { - Printf("Failed to buffer data: %s\n", alGetString(err)); - alDeleteBuffers(1, &buffer); - getALError(); - return retval; - } - - // the loop points were already validated by the previous load. - if ((loop_start > 0 || loop_end > 0) && loop_end > loop_start && AL.SOFT_loop_points) - { - ALint loops[2] = { static_cast(loop_start), static_cast(loop_end) }; - DPrintf(DMSG_NOTIFY, "Setting loop points %d -> %d\n", loops[0], loops[1]); - alBufferiv(buffer, AL_LOOP_POINTS_SOFT, loops); - // no console messages here, please! - } - - retval.data = MAKE_PTRID(buffer); - return retval; -} - void OpenALSoundRenderer::UnloadSound(SoundHandle sfx) { if(!sfx.data) diff --git a/src/sound/backend/oalsound.h b/src/sound/backend/oalsound.h index efa007689..08ac17043 100644 --- a/src/sound/backend/oalsound.h +++ b/src/sound/backend/oalsound.h @@ -126,7 +126,6 @@ public: virtual void SetSfxVolume(float volume); virtual void SetMusicVolume(float volume); virtual SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *buffer); - virtual SoundHandle LoadSoundBuffered(FSoundLoadBuffer *buffer); virtual SoundHandle LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1); virtual void UnloadSound(SoundHandle sfx); virtual unsigned int GetMSLength(SoundHandle sfx);