-
Notifications
You must be signed in to change notification settings - Fork 385
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
Implement auto-mute to improve uncomfortable audio distortion while host is lagging #3866
base: master
Are you sure you want to change the base?
Implement auto-mute to improve uncomfortable audio distortion while host is lagging #3866
Conversation
…he app when minimized
…e when it is unfocused
…in sound settings
…fault values for the fps threshold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this! When I opened the feature request, I had imagined it would be difficult to impossible under the current system, so seeing a proof-of-concept is a huge relief.
@@ -28,330 +28,409 @@ protected override void Dispose(bool disposing) | |||
/// </summary> | |||
private void InitializeComponent() | |||
{ | |||
this.Cancel = new System.Windows.Forms.Button(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry you had to deal with the Designer. If this feature is accepted, I'll rewrite this in a declarative style, then you can rebase and have a smaller diff.
|
||
// Mutes the game if the current FPS reaches the threshold chosen by the user or lower | ||
// An option in the sound settings needs to be turned on for this to work. | ||
if (Config.MuteOnLag && _lastFps <= PlatformFrameRates.GetFrameRate(Emulator.SystemId, Emulator.HasRegions() && Emulator.AsRegionable().Region is DisplayType.PAL) * ((double)Config.FPSThresholdPercentage / 100)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlatformFrameRates are not intended to query the actual core's framerate per se (they are rather "political numbers"). The core's IVideoProvider provides this kind of information and should be used.
resolves #3238
DISCLAIMER : I have done this for a school project. I'm not going to think this is going to be accepted at all, but if you could leave some comments I would be grateful.
Added 2 settings in the Sound Settings menu for muting the app in certain circumstances.
The first one is to mute the app when in the background or unfocused and can be toggled on and off.
The second on is to mute the app when the FPS reaches a threshold chosen by the user (by default 56). It can be toggled on and off and the threshold can also be modified in the settings.
Check if completed: