Sign in to follow this  
Followers 0
cyanidemonkey

dual player?

5 posts in this topic

#1 ·  Posted (edited)

I was looking about for sample scripts for mp3 player because I'm thinking of making a basic mp3 automation script for my Low Power FM station. I've been using WinAmp2.95 and WRS2.0 to automate it, but it sometimes crashes and it's been awhile since I did any AutoIt coding and it's fun).

I found this and am impressed: http://www.autoitscript.com/forum/index.ph...p;hl=mp3+player

I also found this with dual players, but uses WM: http://www.autoitscript.com/forum/index.ph...p;hl=mp3+player

Could a dual deck or mp3 player be done using Sound.au3?

Just wondering really, my main focus will be using date/time to control the players playlist.

Oh, this would be used for long periods 24/7, would it be ok for that kind of work?

cheers.

Edited by cyanidemonkey

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

Share this post


Link to post
Share on other sites



You could write it in Flash with XML playlists and compile your flash to an exe with Zinc v2 http://www.multidmedia.com/software/zinc/

But seriously. I think the most difficult part in AutoIT would be playing the streams simultaneously, you could get your playlists from XML with the XML DOM Wrapper

Share this post


Link to post
Share on other sites

flash :whistle:

way too complicated,

the sound.au3 will not play 2 files at the same time, but the wmplayer.ocx will (see my sample for playing 2 files simultaneously)

CODE
;===============================================================================

;===============================================================================

Global $oPlayer1 = ObjCreate("WMPlayer.OCX")

Global $oPlayer2 = ObjCreate("WMPlayer.OCX")

$song1 = @ScriptDir & "\test1.mp3" ; requires full path name ...

$song2 = @ScriptDir & "\test2.mp3" ; requires full path name ...

$rc = WMLoadFile($oPlayer1, $song1)

MsgBox(0, "1 rc", $rc)

$rc = WMLoadFile($oPlayer2, $song2)

MsgBox(0, "2 rc", $rc)

$rc = WMGetDuration($oPlayer1);

MsgBox(0, "2 rc", $rc)

; turns the volume down and back up slowly... song 1

For $i = 100 To 0 Step - 1

WMSetVolume($oPlayer1, $i)

Sleep(10)

Next

For $i = 0 To 100

WMSetVolume($oPlayer1, $i)

Sleep(10)

Next

; turns the volume down and back up slowly... song2

For $i = 100 To 0 Step - 1

WMSetVolume($oPlayer2, $i)

Sleep(10)

Next

For $i = 0 To 100

WMSetVolume($oPlayer2, $i)

Sleep(10)

Next

MsgBox(0, "pause", "")

WMPause($oPlayer1)

Sleep(300)

MsgBox(0, "play", "")

$rc = WMGetPosition($oPlayer1)

MsgBox(0, "POS", $rc)

WMPlay($oPlayer1)

Sleep(3000)

MsgBox(0, "stop","")

WMStop($oPlayer1)

WMStop($oPlayer2)

exit ; ----------------------------

; some functions

Func WMLoadFile($wm_obj, $sFilename)

$wm_obj.url = $sFilename

While Not WMGetState($wm_obj) = "Playing"

Sleep(100)

WEnd

EndFunc ;==>WMLoadFile

Func WMSetVolume($wm_obj, $iVol)

;iVol can be between 0 and 100

$wm_obj.settings.volume = $iVol

EndFunc ;==>WMSetVolume

Func WMFastForward($wm_obj)

$wm_obj.controls.fastForward()

EndFunc ;==>WMFastForward

Func WMReverse($wm_obj)

$wm_obj.controls.fastReverse()

EndFunc ;==>WMReverse

Func WMPause($wm_obj)

$wm_obj.controls.pause()

EndFunc ;==>WMPause

Func WMPlay($wm_obj)

$wm_obj.controls.play()

EndFunc ;==>WMPlay

Func WMStop($wm_obj)

$wm_obj.controls.stop()

EndFunc ;==>WMStop

Func WMGetPosition($wm_obj)

local $pos

$pos = $wm_obj.controls.currentPosition ()

return $pos

EndFunc ;==>WMGetPosition

Func WMGetDuration($wm_obj)

Local $len

$len = $wm_obj.currentMedia.duration

Return $len

EndFunc ;==>WMGetDuration

Func WMGetState($wm_obj)

local $sStates = "Undefined,Stopped,Paused,Playing,ScanForward,ScanReverse,Buffering,"

$sStates &= "Waiting,MediaEnded,Transitioning,Ready,Reconnecting"

local $aStates = StringSplit($sStates, ",")

$iState = $wm_obj.playState ()

Return $aStates[$iState]

EndFunc ;==>WMGetState

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

sweet, ok, so if I use wmplayer.ocx i need Win Media Player installed? any version?

SO,

Sound.au3 VS. WMMedia.au3

What would be the best for a automation player for an Low Power FM station running 24/7?

I read that WMMedia had some memory hogging issues, is that now fixed?

Cheers for your help guys. I just wanna get this sorted before I start the build.

Edited by cyanidemonkey

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

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