views:

626

answers:

5

My division has been tasked with recording the morning presentation audio for future use, using the built-in Windows Sound Recorder. Because of human nature, we don't always remember to start it on time.

Windows doesn't have a built-in equivalent to the Unix cron function. Besides installing a new software program (which will take time, possibly cost money, and require IA certification), is there an easy way to automate the recording?

I'm not adverse to writing a simple Python script for it, but I haven't programmed for Windows before; I don't know the APIs or anything required for this type of program.


Edit Thanks for the responses. I feel like an imbecile. I don't normally use Windows computers so I wasn't aware that Windows had the Task Scheduler.

However, when I tested it with the recorder program, all it did was open the program; it didn't actually start recording. How do I get it to actually start recording when it is opened?

A: 

Start-Programs-Accessories-System Tools-Scheduled Tasks

Treb
A: 
Prakash
+1  A: 

There is no command line parameter to start in recording mode. You have to Start recording manually!

Prakash
Oops - you're right, of course. But maybe havin the application start up automatically will serve as a reminder. In which case it would make more sense to put a reminder in Outlook/Notes... ;-)
Treb
+2  A: 
set WshShell = WScript.CreateObject("WScript.Shell") 
WScript.Sleep(100)
WshShell.Run "%SystemRoot%\system32\sndrec32.exe" 
WScript.Sleep(100)
WshShell.AppActivate "Sound - Sound Recorder" 
WScript.Sleep(100)
WshShell.SendKeys " " 
WScript.Sleep(100)

Save the above text as RunSoundRecorder.vbs. This will start the sound record application and start it recording. Just point the task scheduler at this file.

Incase you want to make changes:
The third line is the exe to run
The fifth line is the what is in the application title bar.

Craig Norton
What modifications would be made to record the audio to a sound file? The default record time is only 60 seconds. I've looked at nearly a dozen tutorials but they don't get into this type of detail.Thanks for the help though.
crystalattice
I wouldn't use Sound Recorder.Look at different sound recording software...such as Goldwave.I'm not sure what sound recorders are out there but I've used Goldwave in the past to record instruments in my band.
Craig Norton
The principles of activation are the same, just change the past...the AppActivate and then provide the necassary SendKeys.
Craig Norton
+1  A: 

Use AutoIt3

Run ( @SystemDir + "\sndrec32.exe", "workingdir" )
Sleep(5000) ;five seconds
WinActivate( "Sound - Sound Recorder" )
Sleep(100)
Send( " " )

Note: I have not tested this, because I don't use Windows very often anymore.

Definitely worth checking out if you want to automate any Win32 Gui. It actually seems like it has received even more features since I last used it.

Features: ( taken from www.autoitscript.com/autoit3/ )

  • Easy to learn BASIC-like syntax
  • Simulate keystrokes and mouse movements
  • Manipulate windows and processes
  • Interact with all standard windows controls
  • Scripts can be compiled into standalone executables
  • Create Graphical User Interfaces (GUIs)
  • COM support
  • Regular expressions
  • Directly call external DLL and Windows API functions
  • Scriptable RunAs functions
  • Detailed helpfile and large community-based support forums
  • Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008
  • Unicode and x64 support
  • Digitally signed for peace of mind
  • Works with Windows Vista's User Account Control (UAC)
Brad Gilbert