Page 1 of 5

mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 5:29 am
by pmnox
Is there any way to mute the game while I alt-tab the game ?
Or maybe even pause the game as well at the same time?

Every time when I want to do some other stuff I have to close the game, because the music keeps playing even though the game runs in the background. It is so annoying :/
I think that I will have to turn off the music completely.

Another solution would be to stop the music while in the menu after pressing the escape button.

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 8:42 am
by MF-
since you didn't ask for an automatic one: You should be able to mute an application in the system sound mixer
.. so that's why some closed-source games sometimes cut-off their music when I focus another window ..

What about "when the game is paused, the music runs for, say, a minute since the last user activity (mouse motion and window focus) and then nicely fade-out?"

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 11:47 am
by Hi-Torque
That's odd, for me when I press ESC and alt tab out and in the music does stop. I am quite impressed, the last build ran for almost two weeks straight. The new build has been running since last night, alt-tabbing away...in fact I can play another alpha Kerbal Space Program, and Factorio at the same time and the music plays as appropriate.

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 12:30 pm
by MF-
I am not sure whether it plays when I minimize factorio, because I don't do that.

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 12:54 pm
by pmnox
I know that I can use mixer every time I alt-tab the game, but it is really annoying to do. I think that I'll just turn off the music alone from the game menu and just leave the sfx on.

Besides, is there any reason to listen to the game music while I'm not playing it? It is really annoying for me to listen to listen to the game music when I'm trying to play a movie or start another game while Factorio is on.

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 12:59 pm
by MF-
BTW: (nothing immediately useful, true BTW)
This sounds like something that should be implemented in the sound service/API, instead of each individual program.
That way the users would be able to configure it there for all programs at once.
I think it should be possible to write a PulseAudio module that would do exactly that. I tried to search for it, but I guess noone tried yet. (And people with the skills likely don't care. Or just have PA mute the "game" audio streams when a stream with a role "video" or "phone" appears)

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 8:14 pm
by SilverWarior
MF- wrote:This sounds like something that should be implemented in the sound service/API, instead of each individual program.
Could be doable with sound service API but it is not practical. Why? Take next example:
You are chating with a friend of yours via Skype and then you switch to another program which is also capable of producing sounds. You would still like to hear your frinds chat from Skype right? For this to be able you would need to tell your sound service API I still wan't to hear my friend in Sykpe but I would also like to hear sound from this program, but not sounds from other programs.
Where is inpractical thing? Each program would have to notify sound service whter its sounds should be always played or only optional. You can do this simply by alowing or disalowing each program to generate its sounds when inactive or not. You don't need to involve sound service API into this.

Now I understand that sometimes you go and quickly ALT+TAB to som other aplication and you don't like hearing Factorios music in the background all the time.
But what I don't understand is why you don't close the Factorio if you gonna be playing Kerbal Space Program for instance. I mean having both games open and one of them is pused that is just plain stupid. Why? Even when you pause the Factorio or any other game the game still has to rencder its screen (game in the bacground, main menu, etc.). And this is still consuming some of your processing power. More processing power means more energy required. More energy spent means higher electrical bil. But offcourse many our younger players don't care about that much since they are not the ones paying electrical bils.

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 9:08 pm
by MF-
Telephony applications can be easily recognized, that is actually implemented in the current pulseaudio version.
If the user chooses so, music players are automatically "corked" during phone calls. Next release even allows lowering their volume instead of complete mute.

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 9:41 pm
by Hi-Torque
Silver Warior said:
More processing power means more energy required. More energy spent means higher electrical bil. But offcourse many our younger players don't care about that much since they are not the ones paying electrical bils.
Well you certainly have a point there in regards to power consumption. In any case I certainly understand what your saying as I frequently have a similar discussion with my son who is currently in college.

I was trying to understand the issue and testing...I do not normally play two games at once. I still do not understand why Esc/alt tab will mute the music for me but not pmnox?

Re: mute the game while alt-tabbed

Posted: Sun Jun 09, 2013 9:46 pm
by pmnox
Hi-Torque wrote:Silver Warior said:
More processing power means more energy required. More energy spent means higher electrical bil. But offcourse many our younger players don't care about that much since they are not the ones paying electrical bils.
Well you certainly have a point there in regards to power consumption. In any case I certainly understand what your saying as I frequently have a similar discussion with my son who is currently in college.

I was trying to understand the issue and testing...I do not normally play two games at once. I still do not understand why Esc/alt tab will mute the music for me but not pmnox?
Maybe you are using a different operating system?
I use windows 7 64 bit with 64 bit version of Factorio.

Re: mute the game while alt-tabbed

Posted: Mon Jun 10, 2013 1:29 am
by SilverWarior
Just do some testing on this.
After you puse the game the music will continue playing until the end of current song. Next song won't start playing until you resume the game. And you don't even need to ALT+TAB for this.

Also I did some checking and even paused Factorio game which is being kept running in the bacground uses from 10 to 20 percent of my CPU power and somwhere around 30 percent of my GPU power all based on Sysinternals Process Eplorer.
And this is not just some minor processing usage. This can affect playing of some other games on my computer quite a bit. But then this is no gamin laptop even thou I can still run most of the games I just have to keep low settings.

My computer configuration:
Laptop Acer Aspire 6530G
AMD Turion X2 Dual Core 2.0 GHz
ATI Mobility Radeon HD 3650
4GB RAM
Windows 7 Ultimate 64bit

Re: mute the game while alt-tabbed

Posted: Thu May 22, 2014 4:19 am
by chainedlupine
Just to chime in... I'd like to see the music pause when the game is alt-tabbed. I'm running Factorio v0.9.8 Windows 64-bit build.

Everything else pauses, it's just the music which continues playing until the current song is over, then all sound from Factorio stops.

Option to disable sounds when game not in focus

Posted: Mon Jul 24, 2017 6:18 am
by dryswabbie
Would like an option to disable Factorio sounds when the game is not in focus (in background).

I like the sounds when actively playing, but not when I have Factorio in the background while doing other computery things. Hearing the drone of the machinery while on Skype or YouTube can be annoying.

I would recommend the option be named "Background Sound" (Dota) or "Sound Plays While In Background" (Overwatch). Default should be checked (true).

Behavior:
  • User enters Options -> Sounds, then deselects the background sound option.
  • When game not the active window according to the operating system, sound from game is muted.
  • Upon Factorio becoming the active window, sound should be restored.
I do believe the current behaviour should remain the default setting.

Re: Option to disable sounds when game not in focus

Posted: Mon Jul 24, 2017 8:11 am
by bobingabout
I've noticed this in a lot of games. Some force it, rather than being an option.

Some games that force it, I would want the sounds to play in the background, because I'm listening out for certain alerts.

But some sort of option for it in factorio, yes, I would like to see that.

Option to mute sounds when game window is not focused

Posted: Thu Nov 30, 2017 8:02 pm
by MarvinCZ
Hi factorio team, would it be please possible to mute game sounds automaticaly when game window has no focus?

Sometimes I like to keep factorio running in window on one screen while for example watching movie on another and the game sounds are a bit disturbing at that moment.
Going every time to sound settings to set volume all the way down (and then back) could get a bit tedious from time to time.

Or at least making this behavior configurable in game settings would be absolutely great. :)

Thank you very much for considering this feature

Re: Option to mute sounds when game window is not focused

Posted: Tue Dec 05, 2017 5:06 pm
by Gergely
Seconded.

Re: Option to mute sounds when game window is not focused

Posted: Tue Dec 05, 2017 5:10 pm
by mrvn
Thirded or whatever you call that.

A mute hotkey would be nice too. Other than leaving factorio running while watching a movie sometimes my telephon rings and I want quite so I can hear the other person talk.

Re: Option to mute sounds when game window is not focused

Posted: Sun Dec 10, 2017 12:23 am
by MarvinCZ
mrvn wrote:A mute hotkey would be nice too.
Yes, keyboard shortcut for toggling sounds/music would be also super cool. :)

Re: Option to mute sounds when game window is not focused

Posted: Sun Dec 10, 2017 3:09 pm
by PacifyerGrey
This would be really usefull. Upvoting. And it is really easy to implement.

Re: Option to mute sounds when game window is not focused

Posted: Fri Dec 29, 2017 8:10 pm
by MarvinCZ
I agree it shouldn't be so much complicated to implement this option.
Let's hope it will make it to factorio sometime soon. It would be really useful feature.

Or if not this focus-based option (which would be better) at least have a keyboard shortcut to mute game sounds.