There are several situations where it would be to your benefit to listen to a WAV file rather than read a text file.

  • When you are driving home.
  • Someone who is visually impaired.
  • You do not want the contents of a text file edited.

So, I started looking into how difficult it would be to create such a program. As it turns out, not very difficult.

I used AutoIT to create a simple executable that lets you either double click on the program and select a text file or drop a text file right on it. It will then automatically create a WAV file with the same name in the same folder as your original file.

You can download the MakeWAV application for free.

Also, if you are interested, here is the source code that you can copy and compile to make your own application. It’s open source so have fun!

#NoTrayIcon

Opt("MustDeclareVars", 1)
Dim $strTXTFile ;Name of the text file to convert to a WAV
Dim $strWAVFile ;Name of the WAV file to create
Dim $strTextData ;Text information to convert to a

WAV file

If $CmdLine[0] > 0 Then
$strTXTFile = $CmdLine[1]
Else
$strTXTFile = FileOpenDialog("Select Text File...", @MyDocumentsDir, "All (*.*)|Text files (*.txt;*.csv;*.log;*.msg;*.asc)", 1)
EndIf

If Not FileExists($strTXTFile) Then Exit

$strWAVFile = StringLeft($strTXTFile, StringLen($strTXTFile) - 3) & "wav"
$strTextData = FileRead($strTXTFile)
SplashTextOn("", "Creating WAV file. Please be patient.", 275, 20, -1, -1, 1)
_MakeWAV($strTextData, $strWAVFile)

Func _MakeWAV($strSentence, $strFileName)
Dim $oVoice ;SAPI voice object
Dim $oFilestream ;SAPI file stream object
$oVoice = ObjCreate("SAPI.SpVoice")
$oFilestream = ObjCreate("SAPI.SpFileStream")
$oFilestream.Open($strFileName, 3, False)
$oVoice.AudioOutputStream = $oFilestream
$oVoice.Speak($strSentence)
$oFilestream.Close
$oFilestream = 0
$oVoice = 0
EndFunc ;==>_MakeWAV

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Well, it took over a year, but we now have definitive proof that the Lost USB Drive application works! When I launched the Lost USB Drive Experiment in early June of last year, I wasn’t really sure what to expect. I had all but forgotten about the experiment.

So, imagine my surprise when I had this in my inbox this morning:

Dale,

I recently took over Costa Coffee Eastleigh and have found your USB Memory stick, I’m not sure how long it has been here but if you would like to pop in and collect it I will put it to one side.

Thanks

Matthew
Store Manager

Costa Coffee
27-29 Market Street
Eastleigh
SO50 5RG

To be honest, I was a little shocked! But, at the same time, this totally made my day! Just goes to prove that there are some honest people out there and that a little ingenuity can go a long way!

If any of you are in the area of Matthew’s store, go in, congratulate him on his honesty and integrity, and buy the biggest, most expensive coffee on the menu! Way to go, Matthew!

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

I am in the process of performing some analysis on the posts on Daily Cup of Tech. One of the things that I want to do is a word count and frequency analysis on the entire blog.Now, I could go with good ol’ pen and paper and start counting every single word on the blog. But, that would take me quite a mount of time, not to mention that I would not learn anything in the process.

So, I decided to export the contents of my mySQL database the runs behind the scenes at DCoT to a text file and then download a word and frequency counter. Do you think I could find a word counter that would count all of the words in the file and then count how many times each word appears? No luck.

But, my bad fortune is your lucky day. I decided that since I couldn’t find anything like this, I’d make it myself. So. today I present you with the Daily Cup of Tech Word Counter!

The application is a self contained program that is fully portable to USB devices. You can download the program and the source code if you are interested. The program is written in AutoIt.

Here is a screenshot of my new baby:

Most of the program is self explanatory. You can sort the output alphabetically or by how frequent each word appears. You can also sort in ascending or descending order. You can count the words that you type or paste into the edit box or use a text file.

The delete options may be the only confusion portion. When you are counting words, you need to clean up the rough text a bit. Delete some punctuation, get rid on non-printable letters, or scrub out the non-standard English words. Each of these options selects a different one of these options. Control characters are things like carriage returns and line spacing. Punctuation is your standard punctuation that you will find in most documents. Extended characters are characters that you usually do not see regularly and are often used in some non-English languages.

The Use Spaces option will replace all deleted characters with spaces rather than deleting them. This can modify your outcomes so feel free to experiment.

When you are done counting your words, a complete list of all the words and how often they appeared will be presented in the edit box.

Feel free to play around with this and let me know if you find it to be useful.

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

I was doing some research the other day on getting your self out of a difficult situation when you don’t have access to some vital system resources because you are running as a normal user and you lost your local admin password.

I discovered that there is a way to reset your user interface and run interactively as the LOCAL SYSTEM account. This is important because the LOCAL SYSTEM account has a lot of privileges available to it. According to Microsoft:

The system account and the administrator account (Administrators group) have the same file privileges, but they have different functions. The system account is used by the operating system and by services that run under Windows. There are many services and processes within Windows that need the capability to log on internally (for example during a Windows installation). The system account was designed for that purpose; it is an internal account, does not show up in User Manager, cannot be added to any groups, and cannot have user rights assigned to it. On the other hand, the system account does show up on an NTFS volume in File Manager in the Permissions portion of the Security menu. By default, the system account is granted full control to all files on an NTFS volume. Here the system account has the same functional privileges as the administrator account.

A little while back, some enterprising individuals discovered a way to run the LOCAL SYSTEM account interactively. Here are the instructions according to one website:

  1. Start > Run > cmd.exe > type: at 12:03 /interactive “cmd.exe” (replace 12:03 with a time 2 mins from now). > close command prompt
  2. New command prompt will open, when it does > Hit CTRL+ALT+DEL > find explorer.exe and End Process.
  3. At command prompt type: cd.. > type: explorer.exe

This all words fine except that it is a bit confusing for someone who does not understand how all this works. So, I thought I would make it easier for those who do not have my background. I created a little program in AutoIt that completely automated the process. Simply run the program, wait for a couple of minutes, and you’re running as the LOCAL SYSTEM account.

You can download this program and play with it all you want.

WARNING: I have tested this program to the best of my abilities but this does not mean it is perfect. I did not have any problems with it but that does not mean you will not. If something goes wrong, don’t blame me! You’ve been warned.

For those of you who are interested, here is the source code for this little program I wrote. Feel free to hack around and make it do different things:

#include <Date.au3>
If $CmdLine[0] = 0 Then
;No command line options
;First run
$RunTime = _DateTimeFormat(_DateAdd(’n', 1, _NowCalc()),5)
$Command = @ComSpec & ” /c AT ” & $RunTime & ” /interactive “”" & @ScriptFullPath & “”" 2″
Run($Command)
Else
;Second run
$Command = @ComSpec & ” /c taskkill /IM explorer.exe /F & ” & @WindowsDir & “/explorer.exe”
Run($Command)
EndIf

Update: Someone asked in the comments how you get back to your normal account. Simply log out and then log back in as yourself. You should be back to normal.

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

AutoItA new version (3.2.4.9) of AutoIt was released last Friday. If you are an avid AutoIt fan, make sure to update your version of AutoIt. You can download the new version of AutoIt and Scite4autoIt.

Here are the changes in this version from the last major version:

  • Added: StringCompare()
  • Fixed: Basic string comparisons were not working with locale as in previous versions.
  • Fixed: Errors with non-western codepages and ANSI format scripts.
  • Added: Aut2Exe options for forcing ANSI mode compilation (/ansi and /unicode)
  • Added: StringToBinary()
  • Added: Additional unicode related options for BinaryToString()
  • Fixed: StringReplace() and occurances parameter.
  • Added: BinaryToString() for binary buffer to ANSI string quick conversions.
  • Added: @Unicode macro to show if AutoIt is being run in Unicode or ANSI mode.
  • Changed: StringReplace() speeded up - a lot.
  • Changed: Au3Info is now resizable.
  • Fixed: Chr(0) now properly works with Binary()
  • Fixed: Chr(0) now acting more sensible (now acts in a similar way to VBScript).
  • Fixed: FileRead() not working properly with unicode files.
  • Changed: Au3Info graphical tweaks and Summary tab.
  • Fixed: FileReadLine() getting bad cached data when reading specific line numbers with file handles.
  • Fixed: Slight lag in GUIGetMsg() under certain circumstances.
  • Added: ChrW() and AscW() for unicode operations.
  • Fixed: Chr() and Asc() for character codes 128-255 in unicode mode.
  • Fixed: Unicode BOM was not being written in file append modes if the file was empty.
  • Fixed: Error in Include\GuiCombo.au3 and Include\IE.au3.
  • AutoIt is now compiled for Unicode! AutoIt3.exe is Unicode - AutoIt3A.exe is ANSI.
  • Au3Info tool rewritten.
  • Binary data functions completely rewritten - scripts using these functions will need to be changed.
  • Added: New modes for FileOpen() to force Unicode and binary operations.
  • Added: BinaryLen(), BinaryMid()
  • Added: Colored GUI buttons.
  • Added: DllStruct…() can reference elements by name rather than index.
  • Changed: Removed restrictions on the maximum number of #include directives.
  • Changed: Removed restrictions on the maximum number of DllOpen() handles.
  • Changed: Removed restrictions on the maximum number of open files.
  • Changed: Removed restrictions on the maximum number of hotkeys.
  • Changed: Performance improvements in StringStripWS().
  • Changed: Binary data in variants are now treated as a special type, separate from normal strings.
  • Changed: BinaryString() renamed to Binary()
  • Changed: IsBinaryString() renamed to IsBinary()
  • Changed: ControlClick() can now click a control at a certain position.
  • Changed: ControlClick() can now properly simulate double-clicks.
  • Changed: ControlClick() no longer forces the activation of the parent window (up to the user now).
  • Changed: ControlClick() related coordinates added to Au3Info.
  • Changed: Improved the searches that can be done for windows/controls/instances.
  • Changed: From DEFAULT_QUALITY to PROOF_QUALITY for Change/Set Font functions.
  • Changed: x^y compatible with C99 standard.
  • Fixed: Possible crash when using StringStripWS(), flag 4 and empty strings.
  • Fixed: GUICtrlSetLimit() for UpDown controls wher min = max.
  • Fixed: GuiCtrlSetTip() not always working correctly.
  • Fixed: Slow GUI tab redrawing under Windows Vista fixed.
  • Fixed: HotKeySet bad notification.
  • Fixed: FileGetAttrib() on pagefile.sys.
  • Fixed: Invalid default parameter in GUICtrlSetData() not detected.
  • Fixed: Assign does return error on array element.
  • Fixed: FileOpen(”test.txt”, 2+8) returning error.
  • Fixed: Error detection in Enum statement.
  • Fixed: Opt(”WinTitleMatchMode”).
  • Fixed: Stack corruption resulting from improper use of DllCall() now gracefully aborts the script instead of hard crashing.
  • Fixed: Crash when reading empty REG_MULTI_SZ.
  • Fixed: Round() not returning an integer.
  • Fixed: ControlSend() to empty “” ctrl fixed for inactive window. Also shift state behavior.
  • Fixed : O^(-1).
  • Fixed: Non detection of illegal statement.
  • Fixed: HotKeySet(”^{PAUSE]”,… notification.
  • Fixed: {CTRLBREAK} ->{BREAK} as ctrl is user responsability.
  • Fixed: $var = Default passed as parameter to Com object.
  • Fixed: Edit control would always have focus the first time the GUI was displayed even if it shouldn’t. This behavior also ignored $GUI_FOCUS.
  • Fixed: range value for seed Number in SRandom().
  • Fixed: Fileread crash if no count in raw mode.
  • Fixed: Opt(”WinTitleMatchMode”, <0) really matching case insensitive.
  • Fixed: FileSetAttrib/FileSetTime wrong setting.
  • Fixed: Execute/Call recursive overflow display error message.
  • Fixed: Aut2exe warning message if icon not found.
  • Fixed: WinGetTitle() returns 1 on error.
  • Fixed: Memory leak on keyword variable deallocation.

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Next Page »