|I didn't find the source code to modify, so here's one that might work for you, but it's home-made:|
Attribute VB_Name = "sp"
Public xx As Object
c = Command
q$ = Chr(34)
On Error GoTo winme
Set xx = CreateObject("SAPI.SpVoice")
9 Set xx = CreateObject("TextToSpeech.TextToSpeech.1")
On Error GoTo 0
'enable following to test the tts output
'c = q$ + "testing, one, two, three" + q$
'enable the following to test file coupling
'c = "words"
If c = "/?" Or c = "?" Or c = "-?" Then
Shell "cmd /c more say.hlp & pause", 3
If LTrim(RTrim(c)) = "" Then End
'following sets the "voice" via the environment-variable "tts_voice" value
ttsvoc = Environ("tts_voice")
If ttsvoc = "" Then ttsvoc = 0
Set voices = xx.getvoices
Set xx.voice = voices(ttsvoc)
c = c + " "
p = InStr(c, " ")
p3 = 0: words = ""
p2 = InStr(c, Chr(34))
If p2 > 0 Then
p3 = InStr(p2 + 1, c, Chr(34))
If p3 > 0 Then words = Mid(c, p2, p3 - p2)
If words <> "" Then
On Error GoTo 10
Open c For Input As #1
Do While Not EOF(1)
Line Input #1, words
if there is a pair of double-quotes, then the input is interpreted as a literal, otherwise as a filename (including spaces). This could also be vbscripted if you don't have vb.