Skip to content

Commit

Permalink
- Hacky way to eliminate the delay in initializing the volume.
Browse files Browse the repository at this point in the history
  • Loading branch information
EasyT-T authored Jan 10, 2025
1 parent dde7537 commit 62ad7bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gxruntime/gxaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ void gxAudio::SoundChannel::setPitch(const float pitch) {
void gxAudio::SoundChannel::setVolume(const float volume) {
if (!SoundChannel::isPlaying()) return;

this->setPaused(true);
gx_audio.soloud->setVolume(handle, volume);
this->setPaused(false);
}

void gxAudio::SoundChannel::setPan(const float pan) {
Expand Down Expand Up @@ -187,4 +189,4 @@ gxAudio::StreamChannel* gxAudio::playMusic(const char* path, const float volume)
const auto channel = new StreamChannel{*this, stream, handle};

return channel;
}
}

0 comments on commit 62ad7bc

Please sign in to comment.