Freepie : beep and SAPI function?

Official forum for open source FreePIE discussion and development.
Post Reply
Terry
One Eyed Hopeful
Posts: 4
Joined: Sat Jan 18, 2014 2:44 am

Freepie : beep and SAPI function?

Post by Terry »

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..
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Freepie : beep and SAPI function?

Post by CyberVillain »

Hi Terry,
Terry 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..
This will make it beep

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)
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
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Freepie : beep and SAPI function?

Post by CyberVillain »

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

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.
Terry
One Eyed Hopeful
Posts: 4
Joined: Sat Jan 18, 2014 2:44 am

Re: Freepie : beep and SAPI function?

Post by Terry »

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...
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Freepie : beep and SAPI function?

Post by CyberVillain »

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...
What error?

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");
Terry
One Eyed Hopeful
Posts: 4
Joined: Sat Jan 18, 2014 2:44 am

Re: Freepie : beep and SAPI function?

Post by Terry »

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..
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Freepie : beep and SAPI function?

Post by CyberVillain »

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..
Nope, nothing special. Tried it both on Win7 ultimate x64 and win 8.1 x64 without problem.

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
Terry
One Eyed Hopeful
Posts: 4
Joined: Sat Jan 18, 2014 2:44 am

Re: Freepie : beep and SAPI function?

Post by Terry »

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 :roll:


i desinstall freepie and reinstall it without replacing with the new and the function speech is functional!! is it normal ??
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Freepie : beep and SAPI function?

Post by CyberVillain »

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
Post Reply

Return to “FreePIE”