mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix audio volume double/triple-scaling and add About tab
Audio was being scaled by master volume multiple times: once via ma_engine_set_volume, again per-sound in AudioEngine, and again via pre-multiplication in the UI. Removed redundant master volume multiplications so each channel volume is independent and master applies once through the engine. Added About tab to settings with developer info and GitHub link.
This commit is contained in:
parent
83d7f26f33
commit
a250c20d84
2 changed files with 90 additions and 36 deletions
|
|
@ -273,7 +273,7 @@ bool AudioEngine::playSound2D(const std::vector<uint8_t>& wavData, float volume,
|
|||
}
|
||||
|
||||
// Set volume (pitch not supported with NO_PITCH flag)
|
||||
ma_sound_set_volume(sound, volume * masterVolume_);
|
||||
ma_sound_set_volume(sound, volume);
|
||||
|
||||
// Start playback
|
||||
result = ma_sound_start(sound);
|
||||
|
|
@ -361,7 +361,7 @@ bool AudioEngine::playSound3D(const std::vector<uint8_t>& wavData, const glm::ve
|
|||
|
||||
// Set 3D position and attenuation
|
||||
ma_sound_set_position(sound, position.x, position.y, position.z);
|
||||
ma_sound_set_volume(sound, volume * masterVolume_);
|
||||
ma_sound_set_volume(sound, volume);
|
||||
ma_sound_set_pitch(sound, pitch); // Enable pitch variation
|
||||
ma_sound_set_attenuation_model(sound, ma_attenuation_model_inverse);
|
||||
ma_sound_set_min_gain(sound, 0.0f);
|
||||
|
|
@ -462,7 +462,7 @@ bool AudioEngine::playMusic(const std::vector<uint8_t>& musicData, float volume,
|
|||
}
|
||||
|
||||
// Set volume and looping
|
||||
ma_sound_set_volume(musicSound_, volume * masterVolume_);
|
||||
ma_sound_set_volume(musicSound_, volume);
|
||||
ma_sound_set_looping(musicSound_, loop ? MA_TRUE : MA_FALSE);
|
||||
|
||||
// Start playback
|
||||
|
|
@ -510,7 +510,7 @@ bool AudioEngine::isMusicPlaying() const {
|
|||
void AudioEngine::setMusicVolume(float volume) {
|
||||
musicVolume_ = glm::clamp(volume, 0.0f, 1.0f);
|
||||
if (musicSound_) {
|
||||
ma_sound_set_volume(musicSound_, musicVolume_ * masterVolume_);
|
||||
ma_sound_set_volume(musicSound_, musicVolume_);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue