ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Podcast Conversion and dates

<< < (2/2)

skwire:
Here's a proof-of-concept script.  


* Save this to <whatever>.ahk and put it in your fre:ac folder.
* Edit the myOutputDir variable to an output folder of your choice.
* Run the script.  You should see a small square begging for you to drop some files on it.
* Drop some files on it!
* They will be converted to mp3 and placed in your chosen output directory with the original modification times.

--- Code: Autohotkey ---; Set up environment.#NoEnv#SingleInstance, OffSetBatchLines, -1SetControlDelay, -1DetectHiddenWindows, OnSetTitleMatchMode, 2SetWorkingDir, %A_ScriptDir% ; Variables.AppName     := "Podblivion"myOutputDir := "c:\tmp2" ; Build simple drop target.Gui, Add, Text, xm ym w150 h150 Center 0x200 vtxtDisplay, Drop files here...Gui, Show, , % AppNameReturn ; End of auto-execute section.  GuiDropFiles:{    myFiles := A_GuiEvent    Loop, Parse, myFiles, `n    {        If ( A_LoopField != "" )        {            myFilePath := A_LoopField                        ; Notify user that we're doing something.            SetTimer, Progress, On                        ; Get modified time of dropped file.            FileGetTime, modTime, % myFilePath, M                        ; Crack path and form up output filename with mp3 extension.            SplitPath, myFilePath, , , , myFileNameNoExt            myOutputFile := myOutputDir . "\" . myFileNameNoExt . ".mp3"                        ; Set parameters for the freaccmd.exe program.            cmdParams := "-e LAME -m VBR -b -q 5 -d " . myOutputDir . " """ . myFilePath . """"                        ; Convert file.            RunWait, % A_ScriptDir . "\freaccmd.exe " . cmdParams, , Hide                        ; Set output file's modified time to input file's value.            FileSetTime, % modTime, % myOutputFile, M        }    }    SetTimer, Progress, Off    GuiControl, Text, txtDisplay, Drop files here...}Return  Progress:{    GuiControl, Text, txtDisplay, Converting |    Sleep, 250    GuiControl, Text, txtDisplay, Converting /    Sleep, 250    GuiControl, Text, txtDisplay, Converting -    Sleep, 250    GuiControl, Text, txtDisplay, Converting \    Sleep, 250}Return  GuiClose:GuiEscape:{    ExitApp}Return

oblivion:
interesting...  in thinking about a general purpose solution, one question is, can you keep the base filenames the same?
if so then a good general purpose solution might be an app that scans a directory and sets the file date stamps for all sets of files with same basename (and different extensions) to the date of earliest datestamp in the set.
-mouser (March 21, 2011, 09:32 AM)
--- End quote ---
Sorry, I didn't notice this response before. I don't see why you couldn't constrain most conversion apps to work in that way, and it occurs to me that a general purpose app that took that approach might be useful for all sorts of things where you might want the creation date to be retained in a different file format. Photos as well as audio -- maybe even MORE than audio, since I suspect my idiosyncratic approach to podcasts may not be "normal."  :)

oblivion:
Here's a proof-of-concept script. 
-skwire (March 21, 2011, 12:07 PM)
--- End quote ---

Thanks!

It doesn't seem to want to work, though. The script is in the freac app directory (\portableapps\freacportable\app\freac) and freaccmd.exe is present in the same place. I can drop an m4a onto it and it does the "converting" thing for a little while then stops, but I can't find any sign of the output file in the folder I specified (g:\temp) or, indeed, anywhere else.

Any idea what might be going wrong, or how I can watch what it's doing in more detail, perhaps?

skwire:
Any idea what might be going wrong, or how I can watch what it's doing in more detail, perhaps?-oblivion (March 23, 2011, 05:58 AM)
--- End quote ---

On line 43, you can take off the "Hide" keyword.  This will allow you to see the freaccmd.exe window.

Navigation

[0] Message Index

[*] Previous page

Go to full version