Re: Speech recognition

new topic     » goto parent     » topic index » view thread      » older message » newer message

C Bouzy wrote:
 
> Cool....you should add it to the archive.

So how does one zip a bunch of files and upload them? I could do this
as a working demo for newbies to Windows API once I have refined it a bit.

> Thanks for catching this! If possible please send the updated file to Robert
> so he can update the Speech package on the site.

Comments as above so I hope Rob can save the following to SpeechToText.exw 
By the way, I've also changed voice and block to sequences.


include Speech.ew
include Win32Lib.ew
without warning

---------------------------------------------------------------------------------------------
constant
MainWin = create(Window, "Speech To Text", 0, Default, Default, 320, 180,
{WS_MINIMIZEBOX,WS_SYSMENU}),
Text = create(RichEdit, "",  MainWin, 5, 8, 304, 100, 0),
Instructions = create(CText, "Talk into your microphone to see the
text.",MainWin, Center, 120, 304, 20,0 )
---------------------------------------------------------------------------------------------
procedure Open_MainWin(integer self, integer event, sequence params)
 Voice_Init()
 setTimer(MainWin, 0, 100)
end procedure
setHandler(MainWin, w32HOpen, routine_id("Open_MainWin"))
---------------------------------------------------------------------------------------------
procedure Voice_Check(integer self, integer event, sequence params)
sequence voice, block
 if Voice_Result()=1
   then
   block = Voice_Block()
   voice=getRichText(Text,-1)
   setText(Text, voice & " " & block)
   setFocus(Text)
   setIndex(Text, -1 )
 end if
end procedure
setHandler(MainWin, w32HTimer, routine_id("Voice_Check"))
---------------------------------------------------------------------------------------------
procedure Close_MainWin(integer self, integer event, sequence params)
 Voice_Shutdown()
end procedure
setHandler(MainWin, w32HClose, routine_id("Close_MainWin"))
---------------------------------------------------------------------------------------------

WinMain(MainWin, Normal )

Regards,

Bob

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu