smbs Posted February 26, 2014 Share Posted February 26, 2014 I want to hear sound only from active window. If I have additional windows in background playing music I want them to be muted or sound set close to zero % so I do not hear them when playing active window. On changing active window I want the previous active window to be muted--I dont mind having to click on newly activated window in order to restore sound. Any ideas?? Thanx Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 26, 2014 Moderators Share Posted February 26, 2014 Hi, smbs, welcome to the forum. First off, you need to be a little more specific. Are you trying to play a sound when a window is active, or do you mean you have multiple media player windows open and want to switch between them? If you would just like to play a sound from an active window, look at WinWaitActive in the help file. You should be able to do something like this: WinWaitActive("[CLASS:Notepad]", "") ShellExecute(@WindowsDir & "\Media\Notify.wav") "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
smbs Posted February 26, 2014 Author Share Posted February 26, 2014 Thanx for quick reply I have multiple media player windows open or vlc windows open and want to switch between them Many thanx Link to comment Share on other sites More sharing options...
FireFox Posted February 26, 2014 Share Posted February 26, 2014 Hi, Take a look at the Control* functions to automate the mute actions on the players. Br, FireFox. Link to comment Share on other sites More sharing options...
smbs Posted February 26, 2014 Author Share Posted February 26, 2014 I afraid I am a bit "green" on autoit so pls could give me more details or some simple initial code from which I could then continue coding till I am able to mute all inactive windows Thanx once again Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 26, 2014 Moderators Share Posted February 26, 2014 smbs, we were all "green" at one time. This forum is dedicated to helping people learn to use AutoIt; we follow more of a "teach a man to fish" motto, rather than just writing code for you. Our intent is not to be difficult, but to help you learn the language rather than having someone spoon-feed code to you as often happens on other language forums. I would suggest following the steps below, including a lot of reading in the help file. 1. Use the AutoIt Window Info tool (in the same directory where you installed AutoIt) on the media player, and capture the ID of the mute/pause button. 2. Read through the Control commands in the helpfile (ControlClick especially) to see what actions are available to you to click on the button. 3. Once you have something, even if it is not working as you would like it to, post back here and we can try to help further. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
FireFox Posted February 26, 2014 Share Posted February 26, 2014 VLC is made with QT, so I'm afraid you won't be able to do a lot of things. I suggest you to send some keystrokes using the ControlSend function. Br, FireFox. Link to comment Share on other sites More sharing options...
smbs Posted February 26, 2014 Author Share Posted February 26, 2014 ok guys get the message ---many thanx I will try and do it myself and look for more help once I have come up with something... Thanx for instructing me on where to start reading Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 26, 2014 Moderators Share Posted February 26, 2014 Sorry, I missed your reference to VLC. There have been a couple threads about automating QT apps; I see suggestions to check out the thread below. Not sure if it has any concrete examples, however. '?do=embed' frameborder='0' data-embedContent>> "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now