ValleyBell / libvgm

A more modular rewrite of most components from VGMPlay. will include sub-libraries for audio output, sound emulation and VGM playback
irc://irc.digibase.ca/#vgmrips
136 stars 33 forks source link

Volume very low on Psycho Soldier #78

Closed jprjr closed 2 years ago

jprjr commented 2 years ago

Hi there - when I generate audio for Psycho Soldier (using the vgm2wav tool), the volume is very low.

Using the vgm2wav from VGMPlay, the volume seems fine - I think there's a gain setting in the VGM file that's not being applied?

ValleyBell commented 2 years ago

You're right - that's indeed the case. VGMPlay uses the PlayerA class for playback. (yeah, I know, I was super creative with naming) That class does stuff like handling loops, fade out and volume gain.

vgm2wav uses VGMPlayer/S98Player/DROPlayer directly - and so it misses a few things. I didn't update vgm2wav when writing the player wrapper class, sorry.

jprjr commented 2 years ago

Question, from reading the code (haven't tried changing vgm2wav to use PlayerA yet):

It looks like changing the volume is happening in the application layer, VGMPlay calculates a volume gain here, then sets the master volume here

So I'm unsure if just changing to use PlayerA would result in the volume being handled, there's also some steps for the application to take.

Should setting a default volume be instead moved into the library, so a library user doesn't have to be concerned about the VGM file's gain setting? As far as I can tell, I don't think the PlayerA class is handling that (but please correct me if I'm wrong!)

ValleyBell commented 2 years ago

Ohhh, that is a very good catch!

The way it works right now:

I think I did it this way to avoid PlayerA having to know about the details of the VGMPlayer class. It only includes PlayerBase. I'll see if I can add a variable to the PlayerBase that contains the volume information, which PlayerA can then use.

ValleyBell commented 2 years ago

This should be fixed as of 5af16c2bb62a1b2fa5f2b79d55b6007158bc074d.

Can you please check whether or not this fixes the problem for you and close the issue if so?

ValleyBell commented 2 years ago

just a small reminder that you wanted to verify that the issue is solved now

jprjr commented 2 years ago

Oh yes! Sorry about that - this fixes the issue

On April 24, 2022 3:14:42 PM EDT, ValleyBell @.***> wrote:

just a small reminder that you wanted to verify that the issue is solved now

-- Reply to this email directly or view it on GitHub: https://github.com/ValleyBell/libvgm/issues/78#issuecomment-1107900867 You are receiving this because you authored the thread.

Message ID: @.***>