Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text to speech in VFP ?
Message
From
13/10/2001 06:57:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00567966
Message ID:
00568140
Views:
15
>Hi,
>
>I'm working on a game application just to learn some features (use of some classes) of Vfox....it just "kills" objects with a "Laser shot". The objects are dropped in randomic areas of the screen... (something like the old Laser Command game).
>
>And I'd like to add voice sound to the app... I read somewhere that there are APIs to do this... anyone ever tried something like that?
>anyone has code?
>
>I know it sounds weird... but it's my spare time! :)
>
>thanks
>fabian
Fabian,
I think Nick's FoxSpeaker is somewhere in download area. Here is a reduced excerpt of that code :
Public oGenie, oAgent
lcAgent = "f:\winnt\msagent\chars\merlin.acs"
lcCharacter = 'check'

oAgent = createobject("Agent.Control.1")
With oAgent
  .connected = .t.
  .characters.load(lcCharacter, lcAgent)
Endwith

oGenie = oAgent.characters(lcCharacter)
oGenie.Show

oForm = CREATEOBJECT("myForm")
oForm.Show()
Read EVENTS

Define CLASS myform AS form
  AutoCenter = .t.
  DoCreate = .T.
  Caption = "Speak test"
  Name = "Form1"

  Add OBJECT text1 AS editbox WITH ;
    Height = 50, ;
    Left = 10, ;
    Top = 30, ;
    Width = 300, ;
    Value = 'Hello there from Visual Foxpro.'+chr(13)+'Do not hunt foxes.', ;
    Name = "Text1"

  Add OBJECT command1 AS commandbutton WITH ;
    Top = 90, ;
    Left = 10, ;
    Caption = "Konus", ;
    Name = "Command1"

  Procedure Unload
  Release oGenie
  Release oAgent
Endproc
  Procedure queryunload
  Clear events
Endproc

  Procedure command1.Click
  With oGenie
    .Balloon.Visible = .f.
    .MoveTo(thisform.left+objtoclient(thisform.text1,2),thisform.top+objtoclient(thisform.text1,1),200)
    .Speak(ThisForm.text1.Value)
    .Speak(ThisForm.Caption)
  Endwith
Endproc
Enddefine
You need a 'speaking' agent such as Merlin + speech Engine. Visit MS agent site to download them.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform