Spell book sound wrong [RESOLVED]

Locked
User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Spell book sound wrong [RESOLVED]

Post 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.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Spell book sound wrong

Post by Interkarma »

Thanks for letting me know, I'll check it out when I can.

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Spell book sound wrong

Post 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.

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Spell book sound wrong

Post 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?

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Spell book sound wrong

Post 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.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Spell book sound wrong

Post 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!

Locked