AutoHotkey Community

It is currently May 27th, 2012, 4:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: August 18th, 2009, 9:49 am 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
foom wrote:
sCLSID_SpVoice:="{96749377-3391-11D2-9EE3-00C04F797396}"
sIID_ISpeechVoice:="{269316D8-57BD-11D2-9EEE-00C04F797396}"
Are these parameter settings referring to the default voice which is set in Windows?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 24th, 2009, 8:24 am 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 363
Location: north bay, california
DranDane:

a pretty cob solution to the pausing script (which i use for a few functions as a multithreading tool, tested only in xp) as follows, which basically calls a second instance of the script with a command line parameter, that instance only alive to say what needs to be said and then die...

Code:
#SingleInstance, Off
#NoEnv
SetWorkingDir %A_ScriptDir%
SplitPath, A_ScriptFullPath,, Path,Ext,Name
 If %0%
  GoSub, SI_Ran
 Notify("TTS Test","click to close",-300)
 TTS("Testing, 1, 2, 3.")
 Notify("done talking, see the delay?","click to show second instance behavior (or CTRL-F1)",0,"AC=SI_Start")
Return

^F1::
SI_Start:
 If A_IsCompiled
  ToRun := A_ScriptFullPath
 Else
  ToRun := A_AhkPath """ """ A_ScriptFullPath
 SayThis = This is the second instance speaking a really long sentence. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
 Run, "%ToRun%" "%SayThis%"
 Sleep 100
 Notify("First Instance doing something else")
 Loop 10
  Notify("","",-1,"Wait",Notify(A_Index))
Return

SI_Ran:
 ToSay = %1%
 Notify("Second Instance saying:",ToSay,0,"GC=Red")
 TTS(ToSay)
 ExitApp
Return

^1::Reload

#Include *i TTS.ahk
#Include *i Notify.ahk ;= http://www.autohotkey.com/forum/viewtopic.php?t=48668


EDIT: replaced with fully working example showing the second instance behavior, a simple way to prevent the paused script during an asynchronous dllcall or ahk feature (beep...) not very elegant but a 250kb ahk exe running is a small price to pay for the functionality (cmdret and getmail work beautifully with this method)

Note: this example requires Notify() in scripts dir or stdLIB dir, mainly to show you whats going on, so you replace those calls if you prefer, otherwise get it here:
http://www.autohotkey.com/forum/viewtopic.php?t=48668

- gwarble

EDIT: this functionality has been wrapped into Instance() [stdlib] function
http://www.autohotkey.com/forum/viewtopic.php?t=51159

also, if you use TTS (ever) i strongly recommend vista's Anna voice over any xp voice i've tried (except maybe "toshiba adult male" but i can't find it anywhere)... you can get Anna for XP here
http://www.autohotkey.com/forum/viewtopic.php?t=51489


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Pausing the speaking
PostPosted: March 2nd, 2010, 9:59 pm 
Offline

Joined: November 16th, 2006, 12:48 pm
Posts: 59
Location: Dhaka, Bangladesh
But this is not really pausing the speaking, it is creating another instant. Suppose I want to speak a long paragraph and I want to pause, I have to split the string at the pausing point and make the script to run again with the remainder of the text. Is there any way to genuinely pause in the middle.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 10:06 pm 
Offline

Joined: May 23rd, 2009, 4:48 am
Posts: 363
Location: north bay, california
that wasn't the question i answered (look at drandane's post that i replied to)

i dont know of a way to pause the speaking, but maybe in another instance you could pause the whole script externally by processID but i'm not sure if thats possible

- gwarble


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 29th, 2010, 8:09 am 
Offline

Joined: May 11th, 2009, 6:13 am
Posts: 28
I mean we have "MS Mike", "MS Sam" or some other TTS characters, how can i select character for speech?

ok, i got it, to select voice, just use this format
<SAPI><VOICE REQUIRED="NAME=your voice engine">text</VOICE></SAPI>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2010, 11:47 am 
Offline

Joined: March 20th, 2010, 9:49 am
Posts: 224
worked fine with me
nice thing it can switch voices btw SAM <> MIKE <> MARY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2010, 10:05 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
The eSpeak package contains a TTS executable, SAPI5-compatible, that can pause or stop the speech and also change voice, rate and volume. Ironically, SAPI4 - available for Win9x - can also change voice pitch; I wonder why SAPI 5.x can't do that... :roll:

I also am very interested in changing voice, rate, volume of SAPI4-5 though COM. Anyone knowledgeable, please advise. Thank you!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2010, 5:39 am 
Offline

Joined: April 29th, 2010, 3:56 pm
Posts: 8
Is there a way to change the format of the voice? e.g. from the default to 48kHz, 16Bit Stereo

I looked here, and found what I think I'm looking for but do not know how to use DLLCall or COM to change the value.
Code:
Dim f As SpeechLib.SpeechAudioFormatType
f = SAFT22kHz8BitMono       ;The test audio output format

V.AllowAudioOutputFormatChangesOnNextSet = True
O.Format.Type = f               ;AudioOut obj gets SAFT22kHz8BitMono format
Set V.AudioOutputStream = O     ;The "Next Set"

Any help would be appreciated.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 23rd, 2011, 3:41 am 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
I changed dwFlags to 3 which I find more practical, as it will stop any previous speaking and continue with new text, if given.

foom wrote:
Code:
TTS(sSpeechText, dwFlags=3)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2011, 1:15 am 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
Is there any way, AHK can detect THE END of current spoken text from the TTS engine, so it can automatically iterate to next text chunk? Something like RunWait, but for tts, maybe ttsWait?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2011, 1:20 am 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
Flest wrote:
Is there a way to change the format of the voice? e.g. from the default to 48kHz, 16Bit Stereo
Why do you want stereo? Speech is normally a single source, meaning mono. 22 kHz should be also enough as the max frequency is not often above 11kHz. So having mono, 22kHz, 16bit, should be already the best setting.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Found a problem
PostPosted: January 29th, 2012, 6:06 pm 
Code:
#include TTS.ahk

TTS("It will read a sentance with the word 'is' inside it")

TTS("but it will not read the word")

TTS("is")

TTS("on its own")


Report this post
Top
  
Reply with quote  
 Post subject: TTS while typing
PostPosted: January 29th, 2012, 8:12 pm 
Very cool

Could this be used to read each word as I type?

So I hear mistakes along the way?

Thanks

Pip


Report this post
Top
  
Reply with quote  
 Post subject: Say is
PostPosted: February 2nd, 2012, 7:30 am 
You are right PattyCake it will not say the word IS on my system either although it does say other short words. I cant find out why this happens. Anyone else got an idea?


Report this post
Top
  
Reply with quote  
 Post subject: Pause adn stop
PostPosted: February 4th, 2012, 3:18 pm 
Which of these do I use and how do I use these:

ISpVoice::Pause
OR
ISpeechVoice::Pause()


ISpVoice::Resume
OR
SpVoice.Resume

Also - is there a stop?
When it is running, my hotkeys won't stop it.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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