I've finally gotten back into programming. A company called RealSoftware makes a language called RealBasic, which is simple enough that even though I cut my teeth on procedural programming, I can still make sense of object oriented RealBasic. So I'm writing what will be my first attempt at shareware (for money, even!) called Mu-Puppy. Naturally it's a MUSH/MUX/etc client. Below are a few bits of code I wanted to share, since I've been making great use of publicly available code from others.
- Speech Thread
This little code niblet uses the MonkeyBreadSoftware speech plugin, which is part of their RealBasicPlugin package. What this thread does is, assuming the properties are set up right, is allow you to shove text into its array of strings and read them off in order, then shut down when the array is empty again. Asynchronous speech. Woohoo! The method (I call it speak) to put stuff on the buffer looks like this:
Sub speak(speechtext as string)
speaker.speechqueue.append(speechtext)
if not(speaker.running) then speaker.run
End Sub
The properties used by speechthread are set up by this code fragment in App's OPEN event:
//set up the app-wide speech mechanism
speech=new speechmbs
voice=speech.defaultvoice //set this to whatever voice you want - see the MBS docs.
speechchannel=voice.newchannel
speechchannel.speaknumbersliteral=true //set as you see fit.
speechchannel.speakcharactersliteral=false //set as you see fit
speaker=new speechthread
Have fun with these code snippets. Use as you see fit, but you assume all the risks of doing so, yadda yadda.