Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio music & fx volume sliders (Sliders added!) #199

Closed
mrtree3 opened this issue Jun 7, 2022 · 15 comments
Closed

Audio music & fx volume sliders (Sliders added!) #199

mrtree3 opened this issue Jun 7, 2022 · 15 comments

Comments

@mrtree3
Copy link

mrtree3 commented Jun 7, 2022

Describe the feature you'd like to see added

Is there any chance of extra audio options please?

Like a volume slider for music & fx that could be added to tweaks?

Love this work, many thanks.

@linkthehylian
Copy link

Yes, please! This is such a good request and would negate having to adjust its volume manually via volume mixer.

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Hmm, will try looking into this soon, got some ideas for how to try adding it in.

Unfortunately the whole audio system the game uses is pretty undocumented, I tried finding as much from the GC/PS2 releases as I could, but they did also add a lot of custom stuff for the X360/Windows ver that uses XAudio2 which I'm not really sure about.

One very useful thing I just found out though, seems Viewtiful Joe mostly uses the same audio system, and we have some pretty detailed symbols for that, one of those being this struct:

typedef struct %anon154 { /* size 16 */
  sint16 mas_bgm; /* bitsize 16, bitpos 0 */
  sint16 mas_se; /* bitsize 16, bitpos 16 */
  sint16 iss_bgm; /* bitsize 16, bitpos 32 */
  sint16 iss_se; /* bitsize 16, bitpos 48 */
  sint16 str_bgm; /* bitsize 16, bitpos 64 */
  sint16 str_se; /* bitsize 16, bitpos 80 */
  sint16 ssq_bgm; /* bitsize 16, bitpos 96 */
  sint16 ssq_se; /* bitsize 16, bitpos 112 */
} SND_SYS_VOL;

From what I can tell, RE4 seems to be using the same thing :)

E: if anyone wants to help experiment, on 1.1.0 the addrs are

bio4.exe+E3F900 (2 bytes) - mas_bgm (master bgm? mas ones don't seem to affect much...)
bio4.exe+E3F902 (2 bytes) - mas_se (master SE?)
bio4.exe+E3F904 (2 bytes) - iss_bgm ?
bio4.exe+E3F906 (2 bytes) - iss_se ?
bio4.exe+E3F908 (2 bytes) - str_bgm (streamed bgm?)
bio4.exe+E3F90A (2 bytes) - str_se (streamed SE?)

Seems changing those while a sound is playing won't affect the volume until the sound is reloaded, eg. you can change the bgm ones there to 1/2 (16256) while on main menu, and open load save screen, and the BGM volume will be lower, but changing the bgm ones while the save music is playing won't have any effect.

In other words, these volume settings have to be changed before the sound is actually played, guess that could be part of why they didn't add options for this.

The game also likes resetting these at certain points too, I think that's done by the Snd_set_system_vol func.

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Seem to have something working, if anyone wants to help test here's a build:
dinput8_volumeAdjustment.zip

BGM/SE volume can be adjusted in the re4_tweaks Misc menu, seems to mostly work fine, not totally sure if all sounds will be affected by it though - would be interested if anyone finds something that doesn't work with it.

(like post above shows there's also 3 different values for both BGM/SE as well, not completely sure I'm changing all the correct ones, so if you notice some sound effect changing when you adjust BGM, or vice-versa, let me know)

Looks like changing SE volume normally takes effect instantly, but BGMs usually require reload first, maybe can figure out a way to change the BGM volume directly somewhere...

@mrtree3
Copy link
Author

mrtree3 commented Jun 7, 2022

Thank you a lot for trying!

I'll have a go with the zip

@Scoovy
Copy link

Scoovy commented Jun 7, 2022

Seem to have something working, if anyone wants to help test here's a build: dinput8_volumeAdjustment.zip

BGM/SE volume can be adjusted in the re4_tweaks Misc menu, seems to mostly work fine, not totally sure if all sounds will be affected by it though - would be interested if anyone finds something that doesn't work with it.

(like post above shows there's also 3 different values for both BGM/SE as well, not completely sure I'm changing all the correct ones, so if you notice some sound effect changing when you adjust BGM, or vice-versa, let me know)

Looks like changing SE volume normally takes effect instantly, but BGMs usually require reload first, maybe can figure out a way to change the BGM volume directly somewhere...

the inventory sounds seem way lower than sounds for example enemies when using the effect slider, i have the slider on max and the inventory is very hard to hear

2022-06-07.21-21-30.mp4

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Hmm, inventory/sub screens do seem to change one of the volume values to half (0x3F instead of 0x7F), in that DLL I try to track that so volume adjustment will also get applied to the 0x3F instead.

Maybe inventory is actually only changing BGM volume but I'm also applying it to SE as well though, will take another look.

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Here's another build which tracks bgm/se seperately, hopefully should work better now: dinput8_volumeAdjustment-v2.zip

@linkthehylian
Copy link

That new build works perfectly, but I noticed that the changes don't seem to apply during cutscenes. I'm wondering if it could be applied for those as well.

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Looks like cutscenes might have the same issue as BGM where it only takes effect when reloaded (or maybe it's all the str_*/streaming audio which has that problem), will need to try tracking down where it's copying the volume values for those.

Unless you mean the FMV cutscenes, which don't seem to use these volume values at all... guess that's something to do with the Criware/ADX audio they use on them, hm..

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Here's a build which should be able to adjust FMV volume too:
dinput8_volumeAdjustment-v3.zip

(FMV volume is adjusted by the music volume slider, seeing as FMVs usually contain baked in BGM)

@linkthehylian
Copy link

Awesome! Thank you.

Another question, are the sound effects also tied to character speech? I was gonna suggest another possible slider for that as well so that we have full customization over everything in-game that has sound.

@emoose
Copy link
Collaborator

emoose commented Jun 7, 2022

Looks like speech might be handled by the str_se value, at least during cutscenes in movie viewer, unfortunately it looks like cutscene BGM is also being handled by str_se >.>

Not totally sure whether the BGM/SE values I'm changing are actually for BGM/SE or not, looks like BGM slider does affect the menu BGMs at least, don't really know what levels actually have background music playing to check those though.

@linkthehylian
Copy link

Ah, so it looks like they are tied together. I kinda expected that given how old the game is. 😄

don't really know what levels actually have background music playing to check those though

I did the village raid as a test since that part of the game always has music and it seems to work just fine!

@mrtree3
Copy link
Author

mrtree3 commented Jun 9, 2022

Hello, will version 3 be put into re4 tweaks officially or is there more adjustments to make?

I run ver 3 & in the top right corner is an extra re4tweaks menu activated by F2, How do i hide it? Pressing F2 doesn't hide it in my game?

@emoose
Copy link
Collaborator

emoose commented Jun 10, 2022

Should be merged soon hopefully, there's a PR for it at #200 with some more fixes included too (eg. letting BGM volume be changed as it plays)

The build artifact for that PR at https://github.com/nipkownix/re4_tweaks/actions/runs/2477754404 should have that menu disabled AFAIK. (use DLL from the Release folder)

(E: now been merged :) you can get the latest build artifact from https://github.com/nipkownix/re4_tweaks/actions/runs/2478394163)

@mrtree3 mrtree3 changed the title Audio music & fx volume sliders Audio music & fx volume sliders (Sliders added!) Jun 23, 2022
@mrtree3 mrtree3 closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants