mnchartier Posted March 12, 2007 Share Posted March 12, 2007 Using FileCopy to copy faily large files from a mapped drive to local drive and it takes about 8 minutes before the script continues, yet the file is there and can launch the file, but the FileCopy command is still running and the script is hanging. I have also tried to copy the file using a command line and it runs much faster but I do not want to open up another window. Any ideas? Link to comment Share on other sites More sharing options...
Somerset Posted March 12, 2007 Share Posted March 12, 2007 what script? how big are the files roughly... 1 gb? larger or smaller? Link to comment Share on other sites More sharing options...
mnchartier Posted March 12, 2007 Author Share Posted March 12, 2007 (edited) The files are around 500MB audio files here is the script that I have now that I am working with. What I need to do is simplify a Wav file converting. The system making the wav files are making them in 4 channel recordings which can not be played back in Media Player so I am converting them to 2 channel wav files with Audacity. Here is the script that I have now expandcollapse popup#include <GUIConstants.au3> #include <array.au3> #include <Process.au3> ; ----------------------------------------------------------------------------------------------------- Dim $RoomSelect, $DirList, $RecInfo, $RecDirectory,$CourtRm, $List, $Selected, $Info Dim $Audacity = "C:\Program Files\Audacity\audacity.exe" ; Path to the executable for Audacity ; ----------------------------------------------------------------------------------------------------- Call ("Directories") Call ("Input") Call ("Display") Call ("SelectGUI") Call ("Copy") Call ("Convert") Call ("DelDrive") Exit ; ----------------------------------------------------------------------------------------------------- Func Directories() $AddDrive = DriveMapAdd ("m:", "\\Cts-trf-fps-002\Shared\Court Recordings") EndFunc ; ----------------------------------------------------------------------------------------------------- Func Input() $RoomSelect = GUICreate("Select Court Room",250, 175) GUICtrlCreateLabel("Select Court Rm.",20,20) $DirList = GUICtrlCreateCombo("Court Room", 110, 20,75) GUICtrlSetData ($DirList, "1A|2A|2B|2C|2D|2E|2F","1A") GUICtrlCreateLabel("Recording Info", 20, 60) $RecInfo = GUICtrlCreateInput("", 110, 60,100) $Select1 = GUICtrlCreateButton ("Select", 100, 110) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete($RoomSelect) ExitLoop Case $Msg = $Select1 $Selected = GUICtrlRead($DirList) $Info = GUICtrlRead($RecInfo) GUIDelete($RoomSelect) ExitLoop EndSelect Wend $CourtRm = $Selected $RecDirectory = $Selected & "\*" & $Info EndFunc ; ----------------------------------------------------------------------------------------------------- Func Display() $Recording = ("m:\" & $RecDirectory & "*.*") $search = FileFindFirstFile($Recording) If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $List = $List & $file & "|" WEnd $FileList = StringSplit($List,";") EndFunc ; ----------------------------------------------------------------------------------------------------- Func SelectGUI() $SelectRecording = GUICreate("Select Recording") ; will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box $Listing = GUICtrlCreateList("",50,50, 300,200) GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling $Select = GUICtrlCreateButton("Select", 175,300, 50, 30) GUICtrlSetData($Listing,$List) ; Run the GUI until the dialog is closed GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete($SelectRecording) Case $Msg = $Select $Selected = GUICtrlRead($Listing) GUIDelete($SelectRecording) ExitLoop EndSelect Wend MsgBox(0,"Selected File", $Selected) EndFunc ; ----------------------------------------------------------------------------------------------------- Func Copy() $Copied = FileCopy ("m:\" & $CourtRm & "\" & $Selected, "c:\wav_in",9) ;Run ("cmd.exe","m:\") ;WinWaitActive ("C:\WINDOWS\system32\cmd.exe") ;WinActivate("C:\WINDOWS\system32\cmd.exe") ;Send("{ENTER}") ;Send ("cd " & $CourtRm) ;Send ("{ENTER}") ;Send ("copy " & $Selected & " c:\wav_in") ;Send ("{ENTER}") ;Sleep(10000) ;WinClose ("C:\WINDOWS\system32\cmd.exe") ;WinwaitClose ("C:\WINDOWS\system32\cmd.exe") EndFunc ; ----------------------------------------------------------------------------------------------------- Func Convert() $AudacityCheck = FileExists($Audacity) If $AudacityCheck = 0 Then MsgBox(0,"Audacity", "Audacity is not installed please place request to have Audacity installed") Exit EndIf Run ($Audacity) WinWait("Audacity") WinActivate("Audacity") Send ("^o") Send ("C:\wav_in\" & $Selected) Send("{ENTER}") $SelectedLen = StringLen($Selected) $TitleLength = $SelectedLen - 4 $TitleMatch = StringLeft($Selected,$TitleLength) WinWaitActive ($TitleMatch) Send ("!f") Send ("e") WinWaitActive("Save WAV (Microsoft) File As:") WinActive("Save WAV (Microsoft) File As:") Send("c:\wav_out\" & $TitleMatch) Send ("{ENTER}") WinWaitActive($TitleMatch) Send ("!F") Send ("x") EndFunc ; ----------------------------------------------------------------------------------------------------- Func DelDrive() $DelDrive = DriveMapDel ("M:") EndFunc Edited March 12, 2007 by mnchartier Link to comment Share on other sites More sharing options...
seandisanti Posted March 12, 2007 Share Posted March 12, 2007 The files are around 500MB audio files here is the script that I have now that I am working with. What I need to do is simplify a Wav file converting. The system making the wav files are making them in 4 channel recordings which can not be played back in Media Player so I am converting them to 2 channel wav files with Audacity. Here is the script that I have now expandcollapse popup#include <GUIConstants.au3> #include <array.au3> #include <Process.au3> ; ----------------------------------------------------------------------------------------------------- Dim $RoomSelect, $DirList, $RecInfo, $RecDirectory,$CourtRm, $List, $Selected, $Info Dim $Audacity = "C:\Program Files\Audacity\audacity.exe" ; Path to the executable for Audacity ; ----------------------------------------------------------------------------------------------------- Call ("Directories") Call ("Input") Call ("Display") Call ("SelectGUI") Call ("Copy") Call ("Convert") Call ("DelDrive") Exit ; ----------------------------------------------------------------------------------------------------- Func Directories() $AddDrive = DriveMapAdd ("m:", "\\Cts-trf-fps-002\Shared\Court Recordings") EndFunc ; ----------------------------------------------------------------------------------------------------- Func Input() $RoomSelect = GUICreate("Select Court Room",250, 175) GUICtrlCreateLabel("Select Court Rm.",20,20) $DirList = GUICtrlCreateCombo("Court Room", 110, 20,75) GUICtrlSetData ($DirList, "1A|2A|2B|2C|2D|2E|2F","1A") GUICtrlCreateLabel("Recording Info", 20, 60) $RecInfo = GUICtrlCreateInput("", 110, 60,100) $Select1 = GUICtrlCreateButton ("Select", 100, 110) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete($RoomSelect) ExitLoop Case $Msg = $Select1 $Selected = GUICtrlRead($DirList) $Info = GUICtrlRead($RecInfo) GUIDelete($RoomSelect) ExitLoop EndSelect Wend $CourtRm = $Selected $RecDirectory = $Selected & "\*" & $Info EndFunc ; ----------------------------------------------------------------------------------------------------- Func Display() $Recording = ("m:\" & $RecDirectory & "*.*") $search = FileFindFirstFile($Recording) If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $List = $List & $file & "|" WEnd $FileList = StringSplit($List,";") EndFunc ; ----------------------------------------------------------------------------------------------------- Func SelectGUI() $SelectRecording = GUICreate("Select Recording") ; will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box $Listing = GUICtrlCreateList("",50,50, 300,200) GUICtrlSetLimit(-1,200) ; to limit horizontal scrolling $Select = GUICtrlCreateButton("Select", 175,300, 50, 30) GUICtrlSetData($Listing,$List) ; Run the GUI until the dialog is closed GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete($SelectRecording) Case $Msg = $Select $Selected = GUICtrlRead($Listing) GUIDelete($SelectRecording) ExitLoop EndSelect Wend MsgBox(0,"Selected File", $Selected) EndFunc ; ----------------------------------------------------------------------------------------------------- Func Copy() $Copied = FileCopy ("m:\" & $CourtRm & "\" & $Selected, "c:\wav_in",9) ;Run ("cmd.exe","m:\") ;WinWaitActive ("C:\WINDOWS\system32\cmd.exe") ;WinActivate("C:\WINDOWS\system32\cmd.exe") ;Send("{ENTER}") ;Send ("cd " & $CourtRm) ;Send ("{ENTER}") ;Send ("copy " & $Selected & " c:\wav_in") ;Send ("{ENTER}") ;Sleep(10000) ;WinClose ("C:\WINDOWS\system32\cmd.exe") ;WinwaitClose ("C:\WINDOWS\system32\cmd.exe") EndFunc ; ----------------------------------------------------------------------------------------------------- Func Convert() $AudacityCheck = FileExists($Audacity) If $AudacityCheck = 0 Then MsgBox(0,"Audacity", "Audacity is not installed please place request to have Audacity installed") Exit EndIf Run ($Audacity) WinWait("Audacity") WinActivate("Audacity") Send ("^o") Send ("C:\wav_in\" & $Selected) Send("{ENTER}") $SelectedLen = StringLen($Selected) $TitleLength = $SelectedLen - 4 $TitleMatch = StringLeft($Selected,$TitleLength) WinWaitActive ($TitleMatch) Send ("!f") Send ("e") WinWaitActive("Save WAV (Microsoft) File As:") WinActive("Save WAV (Microsoft) File As:") Send("c:\wav_out\" & $TitleMatch) Send ("{ENTER}") WinWaitActive($TitleMatch) Send ("!F") Send ("x") EndFunc ; ----------------------------------------------------------------------------------------------------- Func DelDrive() $DelDrive = DriveMapDel ("M:") EndFuncdo you need to copy the file at all? i mean, it looks like you could just set the output path in audacity, so that it will put the converted file where you want it anyway... Link to comment Share on other sites More sharing options...
Somerset Posted March 12, 2007 Share Posted March 12, 2007 you could use lame to convert it faster without having to open all the while... it is command line, but it is one of the fastest mp3 encoders.... Link to comment Share on other sites More sharing options...
mnchartier Posted March 12, 2007 Author Share Posted March 12, 2007 (edited) The import is even longer pulling it from the network drive When Audacity uses Lame.dll. I also want to give an enduser to edit the volume on the channels also (to be added later by throwing up another message box prompting them to edit and then click ok to continue converting. Edited March 12, 2007 by mnchartier Link to comment Share on other sites More sharing options...
Somerset Posted March 12, 2007 Share Posted March 12, 2007 ok just trying to copy a file that is cd size about 700 mb, from my usb drive takes about 15 minutes.. i tried it with a slightly smaller file and what i can see is this... lets say we are in your destination folder... with it saying that 700 mb is already there, well it truly isn't... it basically is either a false statement or it is just a empty file that is being filled up with the data it is reading. either way it isn't there as fast as what explorer may report. if it takes so much time to down load it through explorer expect roughtly the same time period that autoit will have to take... so if it takes me 20 minutes throught explorer (uncached) autoit won't be much faster than that time frame..... 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