Freepie : beep and SAPI function?
-
- One Eyed Hopeful
- Posts: 4
- Joined: Sat Jan 18, 2014 2:44 am
Freepie : beep and SAPI function?
Hi, i have poor skill in python dev , and i try to rewrite Glovepie code in freePie
so, is it possible to use a Beep(Frequency, duration) function in Freepie script and a say("something") or speak("something") function (using SAPI5.1)
if keyboard.getPressed(Key.C):
Beep(2000, 100)
or
if keyboard.getPressed(Key.C):
Speak("Key C pressed")
there is,may be, some declaration in code to do?
may be also the speech recognition exists too?
i speak about glovepie functions like Beep, Say and SAID
thanks for any help..
so, is it possible to use a Beep(Frequency, duration) function in Freepie script and a say("something") or speak("something") function (using SAPI5.1)
if keyboard.getPressed(Key.C):
Beep(2000, 100)
or
if keyboard.getPressed(Key.C):
Speak("Key C pressed")
there is,may be, some declaration in code to do?
may be also the speech recognition exists too?
i speak about glovepie functions like Beep, Say and SAID
thanks for any help..
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Freepie : beep and SAPI function?
Hi Terry,
Speech is a little harder but possible
http://stackoverflow.com/questions/1375 ... -in-python
I will have to think about if this should be included in core FreePIE
This will make it beepTerry wrote:Hi, i have poor skill in python dev , and i try to rewrite Glovepie code in freePie
so, is it possible to use a Beep(Frequency, duration) function in Freepie script and a say("something") or speak("something") function (using SAPI5.1)
if keyboard.getPressed(Key.C):
Beep(2000, 100)
or
if keyboard.getPressed(Key.C):
Speak("Key C pressed")
there is,may be, some declaration in code to do?
may be also the speech recognition exists too?
i speak about glovepie functions like Beep, Say and SAID
thanks for any help..
Code: Select all
import winsound
if starting:
Freq = 2500 # Set Frequency To 2500 Hertz
Dur = 1000 # Set Duration To 1000 ms == 1 second
winsound.Beep(Freq,Dur)
http://stackoverflow.com/questions/1375 ... -in-python
I will have to think about if this should be included in core FreePIE
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Freepie : beep and SAPI function?
I attached a preview version of the plugin dll that has speech support, overwrite the current plugin dll in your freepie install folder
Test script
Test script
Code: Select all
if keyboard.getPressed(Key.S):
speech.say("Free PIE can now use speech");
You do not have the required permissions to view the files attached to this post.
-
- One Eyed Hopeful
- Posts: 4
- Joined: Sat Jan 18, 2014 2:44 am
Re: Freepie : beep and SAPI function?
hum i have tested -> NOGO
replaced the dll and use your script
if keyboard.getPressed(Key.S):
speech.say("Free PIE can now use speech");
but thats not good, freepie gives exception error...when i run the script
i am in win7 64 bits...dunno if its important...
replaced the dll and use your script
if keyboard.getPressed(Key.S):
speech.say("Free PIE can now use speech");
but thats not good, freepie gives exception error...when i run the script
i am in win7 64 bits...dunno if its important...
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Freepie : beep and SAPI function?
What error?Terry wrote:hum i have tested -> NOGO
replaced the dll and use your script
if keyboard.getPressed(Key.S):
speech.say("Free PIE can now use speech");
but thats not good, freepie gives exception error...when i run the script
i am in win7 64 bits...dunno if its important...
You are missing a tab in your code, should be
Code: Select all
if keyboard.getPressed(Key.S):
speech.say("Free PIE can now use speech");
-
- One Eyed Hopeful
- Posts: 4
- Joined: Sat Jan 18, 2014 2:44 am
Re: Freepie : beep and SAPI function?
no the code is okay..
i have not the error, just windows says "there is a problem, i stop FreePie"
have you installed something special?
i am using SAPI 5.1
may be others guys could give feedback about that..
i have not the error, just windows says "there is a problem, i stop FreePie"
have you installed something special?
i am using SAPI 5.1
may be others guys could give feedback about that..
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Freepie : beep and SAPI function?
Nope, nothing special. Tried it both on Win7 ultimate x64 and win 8.1 x64 without problem.Terry wrote:no the code is okay..
i have not the error, just windows says "there is a problem, i stop FreePie"
have you installed something special?
i am using SAPI 5.1
may be others guys could give feedback about that..
When does it crash? If you do not use speeech does it work? Maybe you want to copy the entire FreePIE folder and run the new dll from there, I now it can be problems with copying over installed files if you have UAC turned on
-
- One Eyed Hopeful
- Posts: 4
- Joined: Sat Jan 18, 2014 2:44 am
Re: Freepie : beep and SAPI function?
oaky when i replace the test of keypressed by if starting: its okay.. i hear beep and speech
but the error comes back when i put the test of keypress
i desinstall freepie and reinstall it without replacing with the new and the function speech is functional!! is it normal ??
but the error comes back when i put the test of keypress
i desinstall freepie and reinstall it without replacing with the new and the function speech is functional!! is it normal ??
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Freepie : beep and SAPI function?
The install program wont overwrite manually copied files so it keeps the plugin version that you copied there.
But I do not understand your error, please tell me more about how you get it
But I do not understand your error, please tell me more about how you get it