Java • 44:45
This session highlights the Mac OS X APIs exposed to Java and demonstrates the use of these beans in a visual development environment via Borland's JBuilder. Overviews and demonstrations of Speech Recognition, Speech Synthesis, Spell Checking, and other Mac OS X Java Beans are presented.
Speaker: Steve Lewallen
Unlisted on Apple Developer site
Transcript
This transcript was generated using Whisper, it has known transcription errors. We are working on an improved version.
Today's session is going to be about describing at a high level what we have to offer in three new Apple Java frameworks: Java Spelling Framework, Java Speech Synthesis Framework, and Java Speech Recognition Framework. These APIs are free and they will be available this week, surely by Friday. They're in the pipeline. We just need to put them on the web from our Apple developers website and you can download them and use them with Java and your favorite IDE, JBuilder that you got in the bag, MetroWorks, ProjectBuilder, what have you, and have some fun with them.
We're not going to go into a lot of detail about how Speech Synthesis and Speech Recognition work or about all their capabilities. By that I mean the underlying technologies built into OS X that have been around for a while in different versions of OS 9, OS 8, etc.
But you can find more information about those things on our Apple Developers website. And we're assuming that you all are familiar with Java. Now one thing we're going to talk about is Java Beans. One of the things we've designed into these APIs is to allow them to be used in visual builders. The premier example is JBuilder.
And before we go on, I just wanted to review exactly what a Java Bean is. So it's basically at a high level method that was designed by Sun and its partners to be able to share discrete data. So Java Bean is a class that has discrete components among third party developers and tool vendors so that each tool can interoperate and use visually these discrete components.
So technically a Java Bean is basically a class that has certain method signatures or another class called a Bean Info that is its pair that describes properties. It can also generate events. So for example, the classic Bean would be a button and you could get an action event on that button, for example.
So Java Bean is a class that has certain method signatures or another class called a Bean Info that is its pair that describes properties. It can also generate events. So for example, the classic Bean would be a button and you could get an action event on that button, for example.
And the Java Bean specification also defines methods to provide editors and customizers. That is, something richer than you'd get by default in a visual builder, such as just editing a string or cranking up a number up and down, switching true to false, etc. And Java Beans, of course, are part of the Mac OS X J2SE implementation, part of all J2 implementations.
So the first framework we'll discuss is the Java Speech Framework. The Java Speech Framework is basically layered upon the Synthesis and Recognition technologies built into OS X, as I said before. These are from Carbon. They exist on Mac OS 9.1 and Carbon as well, the native versions. Of course, we're running on OS X here today.
So what are some of the differences between what we're talking about today and the underlying technologies? Well, the Java Speech API are object-based, whereas the Carbon API are C API, native API. The Java frameworks provide programmatic as well as visual programming for the frameworks. The Carbon API are only programmatic.
Java Speech API are a higher level. The, the Carbon C API provides very, very low level, every single possible thing you'd ever want to do with Speech Syntheis or Speech Recognition. The Java Speech API are only available on Mac OS X. The native API are available on Carbon 7.5 and beyond.
So, Speech Synthesis. Basically, it's about converting text to speech. And we provide in our Java frameworks about 99% coverage of the functionality you'll find in the Carbon API. It's architecturally neutral. Now, what we mean by that is, Speech synthesis provides the ability to get callbacks. Instead of just saying, speak this text, you may want to know when it's done speaking a particular word, a sentence, when it's done speaking a part of a word. You can even stick other cues into the string that it's speaking, and we'll go into that more later, and get callbacks from the speech technology. Now, those callbacks won't necessarily happen on the UI thread of whatever particular UI toolkit you're using, Swing, NBT, IFC, Cocoa, etc.
So what we've done is we've put in a thread task handler and a default implementation for Swing to provide that synchronization for you by default, and an abstraction in the task handler interface that allows you to add your own synchronization between the speech thread and the task handler interface. callback thread, and the UI thread. and we provide Java Beans and customized property editors for tight integration with the Java IDs.
So the main classes-- there are others, but the main 2 classes of speech synthesis are the synthesizer itself. And it basically allows you to speak the text and attach event listeners to the different events that it generates. The voice class which embodies all the characteristics of a voice. Now Mac OS X as Mac OS IX and in previous Mac OSes have, has built in voices, about a half dozen different voices of different characteristics.
One sounds like a robot, one sounds like a young girl, one sounds like an older man, et cetera, et cetera. All these voices have names. And the voice class allows you to pick one of these voices by name, adjust its properties, properties such as the rate with which the voice speaks, its pitch, its volume, et cetera.
We have three basic events we generate from the speech synthesizer. The first event is the word event. You can listen for that event whenever the synthesizer concludes speaking a particular word. You can also listen for the sync event. The sync event is something that you can embed a cue for in the text you're asking the synthesizer to speak. I'll demonstrate that later.
A phonem event, which is used to animate, for example, the face. Let's say you wanted a computer generated face with a mouth to really move with the sound of the word. You would use these callbacks. Again, you can find out detailed information about that callback, those events, in the speech synthesis documentation for Carbon on the Apple Developer website.
So, you also have other events. Since you basically say, here synthesizer, speak this text, and then your thread continues on, you're not going to be able to listen for an exception right there that may be generated down the road. Say the synthesizer itself is a problem. Say you embedded incorrectly some sync event or some other embedded command, and we'll go into embedded commands later.
You can listen for error events. You can also listen for exactly when the synthesizer begins speaking, when it finishes speaking, whether that is someone stopped it, some other API just called stop, stop talking, or it concluded itself, it read all the text, and that would be the done event.
So let's do a speech synthesis demo. And this demo is packaged in the speech synthesis SDK. Let's launch it here. This is just a normal Java app wrapped with MRJ App Builder. And it's built, this is all Java with a swing, Aqua look and feel. And it's built to not only show, not only be a little fun, but be educational. Because I'm assuming that Java programmers that want to do speech synthesis don't necessarily know all the capabilities of the synthesis system underneath on Mac OS X.
So it's fun to play with. We'll go through and we'll just ask it to speak something. We basically have a voice here, Agnes, and we can see her age, 35, about a female, etc., the rate that she speaks, the pitch, bass, and pitch modulation, the volume that she speaks at.
And we'll just ask her to speak. Isn't it nice to have a computer that will talk to you? And maybe we want her to speak a little faster. Isn't it nice to have a computer that will talk to you? So you can play around. So we'll start with these and see the different voices. We'll go through what's some more interesting ones.
And all of these strings, by the way, are actually built into this system. For the particular voices you choose, they particularly exemplify the type of voice that you have selected. So let's look at one more. Let's look at some really alien sounding guys. That looks like a peaceful planet. So different voices. It's pretty interesting. And this, again, is just the Java framework.
Now, another thing that you can do with speech synthesis is embed commands. So let's say, for example, we have many commands that you can embed. An embedded command basically is just a bracketed keyword in the text. That's how you send speech synthesis embedded commands. That's not part of the... That's not part of the Java speech framework. That is actually part of the underlying speech synthesis technology on OS X. And you can do many things. You can change the emphasis of a particular word if you really want to hit it heavily as the computer speaks it.
You can change number mode, for example. And this is interesting. So let's go play with this for a minute. Speech synthesis is pretty intelligent. It tries to guess how it should pronounce numbers. But sometimes you need it to pronounce it single digits. Sometimes you need it to pronounce it digit by digit.
Other times you need it to read it as if it was a whole number, say 502 instead of 502. But let's type something in. Let's say, "Please call me at 555-1234 at extension 1234." Or 5678. 5678. Okay, so first we'll listen to the computer speak this normally. Please call me at 555-1234 at extension 1234. Please call me at 555-1234 at extension 5678. So... And there was a little bit of an interesting hiccup in the highlighting there. But it pronounced the first number correctly. It recognized it as a phone number, so it read it individually.
But an extension number, you wouldn't normally tell someone to call you at 5678. You'd say extension 5678. So we'll embed here the number command to ask it to speak this literally. And then once we're done at the other end of the number, so it returns to a normal number mode, we'll insert the normal command again. And we'll ask it to speak that again. Please call me at 555-1234 at extension 5678. Steve Lewallen So you can do things like that so it's a little more intelligent about what it's pronouncing.
Another thing that... You can do is, among all these embedded commands, is ask for a sync event, as I mentioned a few slides earlier. Let's say you're using Speech Synthesis to do a presentation or something, and after a certain sentence or a certain word, certain paragraph, you want to present a graphic on the screen.
And then you want it to continue on with what it's doing, or you want to sync in some other way a UI with the speech. So let's say... Let's type in a sentence such as, "You can buy product A for $10,000." is the Chief Executive Officer of the Department of Communication and Technology at the University of Minnesota.
He is the Director of the Department of Communication and Technology at the University of Minnesota. He is also the Director of the Department of Communication and Technology at the University of Minnesota. And then let's enter a sync command. And the way you enter a sync command, this is sort of legacy OS 7.5 or so, OS 9-ish, of how they had many four-letter keywords for different technologies in OS.
So in this case, since the roots of this are still in Carbon and earlier OSes, even though I'm on OS X now, we basically need to add a four-letter keyword to our sync event so that when we get a callback, we'll know exactly which callback that was for for the sync event. So first I'll embed this here. And then, and by the way, this is just a convenience, this whole mechanism I'm using to embed these commands. This is just text. So I can actually just cut and paste here.
You can buy product for $5 or product B for $10. Steve Lewallen And so, again, you could use that to animate properly the shape of the mouth of an animated head, for example. So that is speech synthesis. That's about all the capabilities that are in speech synthesis. Steve Lewallen Of course, there are other features that are in speech synthesis. For example, there's the ability to animate the mouth of an animated head. Steve Lewallen And so, again, you can use that to animate properly the shape of the mouth of an animated head, for example.
So that is speech synthesis. That's about all the capabilities that are in speech synthesis. Of course, there are other features that are in speech synthesis. For example, there's the ability to animate the mouth of an animated head. Steve Lewallen There are variations not shown in this demo. For example, you can pause the speech. You can choose to stop the speech at a word break, at a sentence break immediately, and what have you, and same for pausing. But let's continue on now.
to Java Speech Recognition. And this is the nightmare demo, because we've already tried it in here, and I feared this before I even got in this room, and the acoustics, even with none of you in here, really plays havoc with this microphone. But we'll give it a shot anyways. But first let's just talk about Java Speech Recognition. So, Java Speech Recognition.
It recognizes spoken language contained in a language model, and we'll talk a little bit more about a language model later. But that could be something, for example, like call a meeting or a phone home. That's a simple language model in itself. We provide about seventy percent coverage for speech recognition when compared to the Carbon Speech API.
Again, we're architecture neutral, as I said before, with speech synthesis so that you can coordinate the recognition callbacks with your UI callbacks, as a convenience. And again, we provide Java Beans and Customized Property Editor for tight integration with visual IDEs, such as JBuilder or MetroWorks. The two main classes for Java Speech Recognition are the Recognizer, and the Recognizer does about what you'd expect.
It allows you to start recognition, stop recognition, set a particular language model, listen, add your listeners for events, etc. The second important class is the language model. There are two different ways to do this. There are two different ways to use the language model class. One is just, hey, here's an array of different sentences I want you to listen for.
Tell me when you get one of them, and tell me which one you got, which one you recognized. Another one is more complex, and it really is something that if we have time, I'm going to demonstrate a bit, but it's still really an alpha stage for, for a couple different reasons that'll probably be clear when we give that demo. The events that the Recognizer can use, the Recognizer can generate are unrecognized.
Hey, you know, somebody said something but I don't really know what they said. I, it, it didn't match up with anything in my language model that you gave me. And you would use that to do something like ask the user to speak that phrase again. Another event that you can listen for is the detected event.
That just means someone has started to speak, but the, but the Recognizer has not yet completed recognizing what they said. They are not done saying what they're saying. And the, the other event is the done event. This means that the Recognizer actually recognized what they said, and it can tell you exactly what that was.
So, Language Model and Editor. This is an example of a language model. The top model, TopLM, is the top language model and it has two different possibilities. Call Person or Schedule Meeting. Now, Schedule Meeting is literal. Listen for the word Schedule Meeting. Call Person actually is a concatenation of two other models.
The Call Model, third line down, and the Person Model. And the Call Model can be call, phone, or dial. The Person Model could be literally Arlo, Brent, Matt, or my wife. So, in this language model, and then also you have in the Top Language Model with Person or View Today Schedule, variations of the other two.
So, in this language model, you could possibly receive Dial Brent, which would be the first part of the first language model. Or Schedule Meeting, or View Today Schedule, or Schedule Meeting with Brent, for example. So, let's go to the Speech Recognition demo. Keep our fingers crossed. And this is the Speech Recognition mic here.
I'm going to start up Speech Recognizer. Now this is a very simple demo. It was actually something I used to control my web browser, but right now I just have it as a simple list that's going to pick up what I'm saying. So let's wait for it to start. Okay, and if we can cut this mic for a second.
So in the acoustics of this room, some of the softer sounds I found were hard to pick up between this microphone and the fans and all the computers and the different space in the room. But there we see the speech recognition working. And by the way, we're going to go into sample code and actually write some code, take a look at some other code after we're done with these demos. Let me quit this here. And can we have the main presentation board back? Thank you.
So the last framework that I want to take a look at is the Java Spelling Framework. The Java Spelling Framework is a set of Java API that allows you to access the underlying Cocoa Spelling Service, and it's built on the Cocoa Spelling Services, which in turn are built on top of Mac OS X.
It provides three levels of usage, three styles or levels. One is just a simple set of API you can call to ask it, is this particular word spelled correctly, give me a list of suggested corrections, modify the system dictionary. That is, I have a new word, it should be in the dictionary, it's spelled correctly, it just isn't, add it to the dictionary and that would be system-wide so that another Cocoa app such as TextEdit would then pick up that word in its spell checking session. Another way to integrate is complete integration with Swing text components.
Now, I don't know if you're aware, but in Swing, all text components derive from JTextComponent. And JTextComponent has a classic model view controller paradigm design, and that makes it very easy for us to tie in to all text widgets than in Swing, whether it's a one line unstylized text, a multi-line unstylized text, or a fully stylized multi-line text. It also has an attraction for integrating with non-swing text components.
Now, its main classes are the spelling checker itself, and this just basically has the simple static API that you would call if you wanted to just roll all of this yourself. Another important class is the misspelled word class. You'll receive that in callbacks from the spelling panel, which we'll go into later, that will say what word was misspelled, where it was in a group of text, how long it is, etc., so that you can use that to mark up your text, etc. If you're not using the full-featured second mode of operation we described earlier, which is full integration with Java text components. The word class, which is a parent class of misspelled, it just indicates a correctly spelled word.
So this is a snapshot of the classic spelling session. These are all Swing Aqua widgets. And as we can see, we have our classic spelling panel on top of our demo, and I'll show that in a second. And through this panel, you can receive a bunch of different events. But let's see how we bring that panel up.
So, in the case of the second usage, just go to that session on a standard Java text component. It takes these two lines of code. And your text component has to be nothing special. So you just instantiate the JTextComponent driver and you ask it to check the spelling of the text widget. And you can still, if we go back, you can still edit the underlying text component if you wish. And you can just close the spelling panel and manage all of your dictionaries, etc. This spelling panel that's on top now will appear as soon as you call driver.checkspelling.
So another manner of checking the spelling is with the inline popup and real time spell checking. In real time spell checking, you will get cues for misspelled words, which are red dashed underlines, just as you would in any Cocoa application. And by control clicking on the misspelled words, you can get a list of suggested corrections, and you can add and delete things from the system dictionary.
The Javaspelling Framework UI API, which is to do with this window on top, allows you to integrate the spell checking panel with some other text component. There is, since Swing didn't come along for a while in Java's life, many different text widgets out there. And so you can still use, for the most part, the Java Spelling Framework as is with the spelling panel with your own custom text widget as long as you do a few things.
Now one is implementing the JText component. JText component driver, a new implementation of driver. JText component driver is the Swing, default Swing implementation, and you would need to, it implements the interface below driver, and you would need to implement your own implementation of the driver interface. And then, once you did so, you would tie in with the spelling panel, the class above, and you would be able to have this spelling panel tied in with your text component.
Of course, you would have to handle the highlighting and the misspelled word. You would just get queues. And the queues are the same as the text component. The other queues you would get are events generated by the spelling panel. One of the queues would be an event called ignore. The user wants to ignore the currently suggested misspelled word.
Find next. These just basically all apply to the buttons in that spelling panel. Correct. The user wants to correct the misspelling. The correct event would have the choice of the new correct spelling, and it would be your job, if you were implementing this driver yourself, to replace that text. Another event is found, and it would be your job to highlight a misspelled word when you receive that event. So let's take a look at the spell checking demo.
and we'll go through three methods of doing this. So the first one is the standard spell checking session. And as you can see, we have a list of possible suggested corrections to the misspelled word. And it's picked the top one. The top one is always the most likely to be correct. It's not always though, and we'll see that. So in this case, I will choose that word.
But for the third word, I really want-- or the fourth word, I really want one, not the first. And I'll correct that then. And this is just your typical spelling session. But the thing to remember is that this is all Java. These are all Java widgets. This is all Swing accessing the underlying Cocoa Spelling Service. We'll correct that. We'll correct that.
And since this particular integration is that first two line call using full swing integration with the spelling service, when we have a word down below that needs to be highlighted, the text panel scrolled for us, etc., we'll replace that word and we'll replace the last word. So that is the first manner with which you can check spelling. Now let's get back our misspellings and start over.
The second manner is just to simply check them all. So it checks them all and again puts a red underscore misspelling cue under all the misspelled words. And we can right click as we saw in the presentation and select the correct word. We'll just select a few here.
So you can do that as well. Let's get back a fresh copy and go to the real time spell checker. And while that's coming up, all of these calls are being made to check the spelling when it eventually has a word that it wants to find out is this spelled correctly.
It's taken from the world of Java in this particular process and it's sent via DO. Now I don't know if you know anything about DO, but DO is part of, is a distributed objects mechanism in Cocoa. So it's packaged up in Cocoa, sent over the wire to another process running on Mac OS X.
So if you go to the Mac OS X, the spell server, that spell server looks at the word, finds it in the dictionary or doesn't, and sends back a response whether it's spelled correctly or not. So all that happens pretty quickly. And to give you an example, let's turn on the real time spell checker. And let's just type garbage at first.
Let's just type blah, blah, blah, blah, you know, who knows what this is. But as you can see, as I type, it is checking every single correction I make to the document. And all of that is just happening extremely rapidly. Now let's go back and let's actually do something.
Look at our classic sentence again. So since the real time spell checker is still on, we can delete, make our correction manually. We know that this for ISS, for example, should be is. But we can also then do as we did for the check all option, which is to ask it to give us a list of suggested corrections. And we can correct it in this manner. So that is a demo of Java Spell Checking.
So where to get the code? You'd go to Apple's Java Developer website. Sometime this week, I'd look by Friday and it'll definitely be there. But while we're on the subject of code, let's see how easy it is just to roll some of these things our own. And let's see a bit about what I was talking about when I said Java Beans. So let's launch JBuilder. . And let's close this nice little app again. Let's get this guy up again. Since the demigods don't like me, I think I'll begin to save incrementally. Okay. Okay, let's save all. Let's go back to the visual designer.
Let's add our Speech Syntheis Bean again. Okay. And let's set the layout of this. This will be the world's most horrible GUI. to Null, meaning XY. Let's go back to-- "Let's add a button to start Speech Synthesis, another one to stop it, And let's add a swing scroll panel. And inside of that, let's add a text widget. And let's put some default text in it.
[Transcript missing]
And save again. And let's go and, you know, we won't even bother naming those buttons. Let's go and ask the synthesizer to begin speaking. So let's say this. I love this feature of JBuilder. It's just totally awesome. This is Code Insight. So especially during these demos, this is really great. J synthesizer should be down there somewhere. Did it name it just synthesizer? I think it did. Okay.
Synthesizer1. Text and we'll get that text from this dot j text area one dot git I can't get any easier than that. Well, I could write it itself, but then I'd be out of a job. OK. Don't add that feature, Blake, please. So let's go back and add stop.
[Transcript missing]
Okay, let's run it. Obviously this is about the simplest form of using the synthesizer, but you could also add callbacks to it, but we'll just take a look at those events. So we can speak it. This is neat. Let's add a bunch of stuff and hope that stop works, because otherwise it's going to repeat this over and over.
[Transcript missing]
I actually knew it would work, but thank you. So that is Speech Synthesis. So while we're in this demo, Let's add one more button to the beauty of JBuilder. And let's add our spell checking button, our spell checking bean. One more time. This.jtext.complete.
[Transcript missing]
That's right. Let's bring up the spell checking panel, that one line of text that we added. And let's see if it has a guest for me here. Yes it does. Okay, so we'll do that and correct that spelling.
It doesn't have one for there, so I'll just change it myself there. It does have one for that. For the heck of it, let's just say ignore that one. And let's also say that for whatever reason, we want that word to be declared as spelled correctly. So let's learn it.
and continue on. And then just kill our session here. And then we can just continue on or whatever. Now let's open up. Let's quit that. So there are two examples of easily incorporating the Speech Synthesis and Spell Checking framework into your application. If we look again, we need to look at the top of this application because JBuilder did some things for us. It instantiated the JTEX component driver when we added it to the application visually. It also did the same thing for the synthesizer class as well.
And then when we look down at our code below, it just took one line of code to ask the synthesizer to speak the text, another line of code to ask it to stop it, one line of code to ask it to check the spelling. And for checking the spelling, they're also checking real time and check all API as well. So any way you slice it, you have a couple lines of code that only would work if you had a specific code.
So any way you slice it, you have a couple lines of code that only would work if you had would work on Mac OS X, but then again, since there are only a couple of lines of code and because of the types of frameworks they are, for example spell checking, you might want to consider integrating them into your application--your Java applications that you want to run on all platforms. The way--there are several ways you could do this, but the benefit is that it would basically run the same on all the platforms.
It's just that when you got to Mac OS X and your users ran it there, they'd also have, for example, spell checking. So you might use, since it's only a couple lines of code for spell checking reflection to call this, you might also wrap it in another API, build it on Mac OS X or build it on a platform that has these same APIs stubbed out so you could compile and then run it on all of your systems and simply when it ran on Mac OS X, it would have the spell checking capabilities built into it.
And same for basic speech synthesis, although, you know, that may be more involved in your application when you do that. So you might use--since it's only a couple lines of code for spell checking reflection, you might also wrap it in another API, build it on Mac OS X or build it on a platform that has these same APIs stubbed out so you could compile and then run it on all of your systems, and that's where you might use speech synthesis.
So those are the first two easy frameworks to demo. Now the bleeding edge guy is speech recognition. So let's actually go and open up a new file--open up a file that was put on our system when we installed the speech framework. Okay, let's see here. Do, do, do, do, where am I piloting here? Close that. Okay. Developer.
[Transcript missing]
Okay, let's look at example one. This is the sample code to the speech recognition sample we saw. And for the most part, what it's doing is instantiating the recognizer.
[Transcript missing]
The feedback frame, what recognizer it should attach to, and it's gone and attached to all the listeners, especially the done event listener, so that it can highlight the correctly spelled, or correctly spoken phrase. Now, The other thing that I wanted to show you that is the real bleeding edge stuff-- let me close this file.
Let's go back to the designer. And let's go and just add a recognition bean to this little sample application. and take a look at the rough early version of the language model customizer. So the thing that actually makes this rough is that drag and drop, probably if you're familiar with Java at all, you know, is still in a rough state of affairs.
Not only do we have some bugs on our side, but there are just some bugs in the shared code that all of the VM implementers share with Sun, and I basically discovered those specific bugs while doing this editor, and we need to get those changes fed back to Sun, get them into the pipeline so everyone can benefit from them.
But I will try to work, struggle my way through this to give you a bit of an example of how it works. So I'm going to try to recreate that first language model we had on the slides, where we had a call person, for example, schedule a meeting with a person. So let's say for, first of all, that we just wanted to say, "schedule meeting with person." So we could say, we could add a new language model down here.
Oops, I need to add a new one first. Called Person. And we could say this is, let's see. We could say that this is Dan. Mickey and some of mine not in the room and and then we could say We could drag this person. Now this is part of this feedback window. It's one of the bugs of... : Thank you, Steve. I'm going to go ahead and show you a little bit of the code that I was referencing before.
So we could type up here, "call person." And then I should be able to say, call Dan or call Nikki. Now, the actual--we had a bit of a difficulty with setting up the mic, so the development environment for this sample is on this machine I'm sitting on here, and the mic actually is attached to the other machine, so I can't actually show you this working, but trust me, it works. : I'm dragging it up, it's only a problem. But you can go into a test mode and build your language model. You could speak it, et cetera, go back to edit mode to edit other things. Once you're done, you can save it as a file somewhere.
And it'll bring up the OS X save dialog box, just save it somewhere, and say, okay, you're done. And then if we go back and we look at the source, JBuilder, because JBuilder adheres to even the nitty-gritty of the Bean specification, it's gone and used the Java Speech Recognition--Recognizer Bean language model, BeanInfo and Bean, to allow us, our framework, to add source code to the file that you're editing. That's pretty neat. In this case, the source code we added was-- and allow me to just add this to two lines so you can see it better.
The source code that we added was new language model, set data file for the particular file that now contains our language model. And then we could listen for those same phrases, call Dan, call Nikki, out of that complex language model. Now more will be added to that so that you can have easier ways to recognize a more complex model, but that's the state of the situation with speech recognition at the moment.
So speech recognition is provided as one of those frameworks made freely available on our website as of this week. The way that I would recommend you use it for the time being is with The simple language model that we saw below, which is just setting a simple set of phrases, listening for the recognition event, the done event, and then getting the sentence out of that event to see what the user has spoken.
So that's a bit of code in taking a look at how easy it is to use the frameworks. Of course, there's a lot more in the frameworks than we've shown today. There are all sorts of interesting things and callbacks and synthesis and recognition that you can get at. We've actually covered most of the spelling framework as is. So again, you can get the code from the developer website. And send me email if you have any questions.