Page 1 of 1

Spell book sound wrong [RESOLVED]

Posted: Mon Jul 09, 2018 7:35 pm
by MeteoricDragon
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.

Re: Spell book sound wrong

Posted: Tue Jul 10, 2018 1:20 am
by Interkarma
Thanks for letting me know, I'll check it out when I can.

Re: Spell book sound wrong

Posted: Sat Aug 04, 2018 1:21 pm
by R.D.
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.

Re: Spell book sound wrong

Posted: Sat Aug 04, 2018 2:07 pm
by R.D.
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?

Re: Spell book sound wrong

Posted: Sat Aug 11, 2018 10:18 am
by R.D.
I found the bug. The issue seems to be that this line in DaggerfallSongPlayer.cs:

Code: Select all

audioSource.volume = DaggerfallUnity.Settings.MusicVolume;
causes the Daggerfall Song Player object attached to DaggerfallUI to adjust the volume of its audioSource. Then, when an inventory sound calls

Code: Select all

dfAudioSource.PlayOneShot(clip, 0);
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.

Re: Spell book sound wrong

Posted: Sun Aug 12, 2018 12:22 am
by Interkarma
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.
Thank you for tracking that down! Makes sense in hindsight.

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!