Jump to content
Sign in to follow this  
smbs

win 8 -- play sound from active window only

Recommended Posts

smbs

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

Share this post


Link to post
Share on other sites
JLogan3o13

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")

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
smbs

Thanx for quick reply

have multiple media player windows open or vlc windows open  and want to switch between them

Many thanx

Share this post


Link to post
Share on other sites
FireFox

Hi,

Take a look at the Control* functions to automate the mute actions on the players.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
smbs

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

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
FireFox

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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
smbs

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

Share this post


Link to post
Share on other sites
JLogan3o13

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>>


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×