AutoHotkey Community

It is currently May 27th, 2012, 9:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: January 11th, 2007, 12:17 pm 
However, it is quite possible I'm missing some required software or
other.[/quote]

My bad. Moving the lines to the top of my AHK script fixes things.

The program works - but regularly crashes with two types of error message.

I've cannibalised the loop to play my own .wav files within AHK, which at least deals with key feedback issue on many keys:

key_sounds_other = @QWERTYUIOPASDFGHJKLZXCVBNM1234567890qwertyuiopasdfghjklzxcvbnm=<>.,()!?"'\$&|[]{} _

Loop Parse, key_sounds_other
{
HotKey ~%A_LoopField%, Speak
}
Speak:
SoundPlay, C:\Documents\Audio\wav\key_sounds\typewriter\other.wav, Wait
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2007, 3:09 pm 
Tim Tyler wrote:
BoBo wrote:
Why not use XPs build in Narrator?
Start/Programs/Accessories/Accesability/Narrator/Read Typed Characters



On my system, that announces windows events, and reads text files you load, even if you only have the 'read characters' option on.


Same here. I did find a free solution, although it doesn't involve AutoHotKey:

http://shpits.com/ShpitsMedia/talkingkeyboard.html

I'm not crazy about the voice wav files it uses, so I'll make my own and overwrite the ones it installs in the Program Files\TalkingKeyboard directory. The program is much more responsive than my AutoHotKey script.

Thanks for all your suggestions!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2007, 3:56 pm 
Offline

Joined: January 1st, 2007, 10:32 am
Posts: 17
Laszlo wrote:
Why don't you create a separate vbs file for each key and run them when that key is pressed? It should give you a little more speed, but probably not much.


That works - and works extremely effectively, IMO.

Any idea why I can do this:

Run C:\Documents\Audio\vbs\refresh.vbs

but not this:

Run C:\Documents\Audio\vbs\speak.vbs "Refresh"

AHK ignorantly says it cannot find the file specified.

Code:
If WScript.Arguments.Count = 0 Then
   WScript.Echo  "no argument on the command line."
Else
   For each arg in WScript.Arguments
      WScript.Echo  "argument:" & arg
      Dim Talk
      Set Talk=WScript.CreateObject("SAPI.SpVoice")
      Talk.Rate=3
      Talk.Speak "" & arg
   Next
End If

_________________
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2007, 4:45 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
That's because you can only pass parameters to executables, not files that are associated with executables. You have to specify the executable and pass the file as a parameter, which is functionally identical but also allows you to pass the parameter (if the language supports that, in the case of an interpreter). For instance, you couldn't do 'Run script.ahk Param1 Param2', you have to do 'Run AutoHotkey.exe script.ahk Param1 Param2'.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2007, 7:35 pm 
Offline

Joined: January 1st, 2007, 10:32 am
Posts: 17
jonny wrote:
That's because you can only pass parameters to executables, not files that are associated with executables. You have to specify the executable and pass the file as a parameter, which is functionally identical but also allows you to pass the parameter (if the language supports that, in the case of an interpreter). For instance, you couldn't do 'Run script.ahk Param1 Param2', you have to do 'Run AutoHotkey.exe script.ahk Param1 Param2'.


...so I need:

Run wscript C:\Documents\Audio\vbs\speak.vbs "Refresh"

...with my:

Code:
If WScript.Arguments.Count = 0 Then
   WScript.Echo  "no argument on the command line."
Else
   For each arg in WScript.Arguments
      WScript.Echo  "argument:" & arg
      Dim Talk
      Set Talk=WScript.CreateObject("SAPI.SpVoice")
      Talk.Rate=5
      Talk.Speak "" & arg
   Next
End If


Yay: it works! ;-)

Execute lots of them very quickly and I still see errors, though.

_________________
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2007, 4:12 pm 
Offline

Joined: January 1st, 2007, 10:32 am
Posts: 17
timtyler wrote:
jonny wrote:
That's because you can only pass parameters to executables, not files that are associated with executables. You have to specify the executable and pass the file as a parameter, which is functionally identical but also allows you to pass the parameter (if the language supports that, in the case of an interpreter). For instance, you couldn't do 'Run script.ahk Param1 Param2', you have to do 'Run AutoHotkey.exe script.ahk Param1 Param2'.


...so I need:

Run wscript C:\Documents\Audio\vbs\speak.vbs "Refresh"

...with my:

Code:
If WScript.Arguments.Count = 0 Then
   WScript.Echo  "no argument on the command line."
Else
   For each arg in WScript.Arguments
      WScript.Echo  "argument:" & arg
      Dim Talk
      Set Talk=WScript.CreateObject("SAPI.SpVoice")
      Talk.Rate=5
      Talk.Speak "" & arg
   Next
End If


Yay: it works! ;-)

Execute lots of them very quickly and I still see errors, though.


The /B switch on wscript supresses the errors - e.g.:

Run wscript /B C:\Documents\Audio\vbs\speak.vbs "speech"

_________________
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2007, 4:26 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
You were not careful on classes :)

Bobo, punish them

Code:
again:
;exit on ESCAPE
   Input, c, BIL1, {ESC}

   if ErrorLevel=EndKey:Escape
      ExitApp

   if (c != "") and (c !=" ")
      Run say %c%
goto again


http://www.autohotkey.com/forum/viewtopic.php?t=14935

You can put say.exe on RAMDRIVE for the fastest execution, although it can hardly be faster with 20KB app....

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, XstatyK, Yahoo [Bot] and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group