Sign in to follow this  
Followers 0
nobbe

Enhancement to playing Video Files also

3 posts in this topic

hi

Autoit 3.2.2

in module "Sound.au3" i added a few lines to play differnet fileformat too and video (original code didnt display video output on my machine )

Func _SoundOpen($hFile, $sAlias = "")
    ;Declare variables
    Local $sSnd_id, $iCurrentPos, $iRet
    
    
    ;check for file
    If Not FileExists($hFile) Then Return SetError(2, 0, 0)
    ;search for whitespace by character
    For $iCurrentPos = 1 To StringLen($sAlias)
        If StringIsSpace(StringMid($sAlias, $iCurrentPos, 1)) Then Return SetError(3, 0, 0)
    Next
    ;create random alias if one is not supplied
    If $sAlias = "" Then
        $sSnd_id = RandomStr(10)
    Else
        $sSnd_id = $sAlias
    EndIf


    ;
    ; for opening other files as well (AVI, MUS, DIVX)  
    ;
    ; MUS = MPEG 1 Layer2 audio file format for Broadcast Station (DAB) etc .. 
    ;

    If StringInStr(FileGetShortName($hFile), ".MUS") > 0  Or StringInStr(FileGetShortName($hFile), ".AVI") Or StringInStr(FileGetShortName($hFile), ".DIVX") Then
        $iRet = mciSendString("open " & FileGetShortName($hFile) & " type MPEGVideo alias " & $sSnd_id)
    Else
        $iRet = mciSendString("open " & FileGetShortName($hFile) & " alias " & $sSnd_id)
    EndIf
    ; --- end enhancement 



    Return SetError(0, $iRet, $sSnd_id)
EndFunc   ;==>_SoundOpen

Share this post


Link to post
Share on other sites



hi

maybe better move in developer category?? i wasnt shure

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