Jump to content

Launch .m4a audio file with Media Player minimized / hidden


 Share

Recommended Posts

Hi,

I want to launch a .m4a audio file using the default Media Player.  I want the Media Player to run minimized / hidden and not be displayed.   I only want to hear the audio without the Media Player being displayed.  

I tried this but Windows Media Player still pops up in the foreground. 

ShellExecute("c:\myaudio.m4a", "", "", "", @SW_MINIMIZE)

Any suggestions would be greatly appreciated

Kris

Link to comment
Share on other sites

Don't fight with external software, just use its COM OCX.

Local $sFullPath = "C:\Applications\AutoIt\WASApi\The Rolling Stones\The Rolling Stones - Lady Jane.mp3"
Local $oPlayer = ObjCreate("WMPlayer.OCX")
$oPlayer.URL = $sFullPath
$oPlayer.Controls.Play

Sleep(1000) ; Let enough time to start

While $oPlayer.playState = 3     ; 1 - stopped, 2 - paused, 3 - playing
  Sleep(100)
WEnd

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...