The spell book open/close sound effect volume is linked to the music global volume adjustment, rather than the sound global volume. Try adjusting the volume of music and then opening the spell book and you'll see what I mean.
EDIT: It is linked to both music and sound volume.
Spell book sound wrong [RESOLVED]
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Spell book sound wrong
Thanks for letting me know, I'll check it out when I can.
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: Spell book sound wrong
It's not just the spell book, it also happens with equip sounds. Seems like it affects all UI sounds. I took a quick look at the code but I didn't see anything obviously wrong that would cause this.
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: Spell book sound wrong
I looked into it a little more, and found the following:
1) The UI sounds are affected by both the sound volume and the music volume, even though the line, in DaggerfallAudioSource.cs, is just:
audioSource.PlayOneShot(clip, volumeScale * DaggerfallUnity.Settings.SoundVolume);
and doesn't reference DaggerfallUnity.Settings.MusicVolume.
2) Confirmed that DaggerfallUnity.Settings.SoundVolume is not changed when the music volume is adjusted.
Maybe a bug with the volume in audioSource.PlayOneShot() applying to both sound and midi?
1) The UI sounds are affected by both the sound volume and the music volume, even though the line, in DaggerfallAudioSource.cs, is just:
audioSource.PlayOneShot(clip, volumeScale * DaggerfallUnity.Settings.SoundVolume);
and doesn't reference DaggerfallUnity.Settings.MusicVolume.
2) Confirmed that DaggerfallUnity.Settings.SoundVolume is not changed when the music volume is adjusted.
Maybe a bug with the volume in audioSource.PlayOneShot() applying to both sound and midi?
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: Spell book sound wrong
I found the bug. The issue seems to be that this line in DaggerfallSongPlayer.cs:
causes the Daggerfall Song Player object attached to DaggerfallUI to adjust the volume of its audioSource. Then, when an inventory sound calls in DaggerfallUI, it uses the audioSource's adjusted volume.
Since the Daggerfall Song Player object attached to DaggerfallUI is only used in the setup screen, one way to fix is to clear the checkbox for the song player attached to the DaggerfallUI object in the DaggerfallUnityGame scene (thereby disabling it), but that might not be an ideal solution.
Code: Select all
audioSource.volume = DaggerfallUnity.Settings.MusicVolume;
Code: Select all
dfAudioSource.PlayOneShot(clip, 0);
Since the Daggerfall Song Player object attached to DaggerfallUI is only used in the setup screen, one way to fix is to clear the checkbox for the song player attached to the DaggerfallUI object in the DaggerfallUnityGame scene (thereby disabling it), but that might not be an ideal solution.
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: Spell book sound wrong
Thank you for tracking that down! Makes sense in hindsight.R.D. wrote: ↑Sat Aug 11, 2018 10:18 am Since the Daggerfall Song Player object attached to DaggerfallUI is only used in the setup screen, one way to fix is to clear the checkbox for the song player attached to the DaggerfallUI object in the DaggerfallUnityGame scene (thereby disabling it), but that might not be an ideal solution.
I have no problems disabling that particular song player component. The startup scene can just get a standalone song player for itself with no harm done.
Edit: Have removed SongPlayer from DaggerfallUI in DaggerfallUnityGame scene but left it on the DaggerfallUI object in DaggerfallUnityStartup scene. This seems to resolve the issue with no other outcomes.
Good spot Allofich, and thank you for the fix!