How I can catch the word that was spoken in a string??

Hi
i'm doing a java aplication with speech recognition jsapi and i want know how  i can convert tag form FinalRuleResult  to string??
i want  catch the word that was spoken in a string to  evaluate the string in the sentences if                               
this is the code that i have developed:
public static void main(String[] args)
     {prueba inst = new prueba();
               inst.setVisible(true);
          try {
               RecognizerModeDesc descripcion = new RecognizerModeDesc(null, Boolean.TRUE);
               SpeechEngineChooser chooser = SpeechEngineChooser.getRecognizerDialog(descripcion);
               chooser.show();
               descripcion = chooser.getRecognizerModeDesc();
               reconocedor = Central.createRecognizer(descripcion);
               reconocedor.addEngineListener(new TestEngineListener());
               RecognizerAudioAdapter raud = new TestAudioListener();
               reconocedor.getAudioManager().addAudioListener(raud);
               reconocedor.allocate();
               reconocedor.waitEngineState(Recognizer.ALLOCATED);
               RuleSequence secuencia = new RuleSequence();
               RuleTag comando1 = new RuleTag(new RuleToken("vol"),"VOL");
               RuleTag comando2 = new RuleTag(new RuleToken("channel"),"CHANNEL");
               RuleTag comando3 = new RuleTag(new RuleToken("end"),"END");
               RuleTag comando4 = new RuleTag(new RuleToken("up"),"UP");
               RuleTag comando5 = new RuleTag(new RuleToken("down"),"DOWN");
               RuleAlternatives comandos = new RuleAlternatives();
               comandos.append(comando1);
               comandos.append(comando2);
               comandos.append(comando3);
               secuencia.append(comandos);
               RuleGrammar gramatica = reconocedor.newRuleGrammar("basepatrones");
               gramatica.setRule("testRule",secuencia,true);
               gramatica.setEnabled(true);
               reconocedor.suspend();
               reconocedor.commitChanges();
               reconocedor.waitEngineState(Recognizer.LISTENING);
               reconocedor.requestFocus();
               reconocedor.resume();
               reconocedor.addResultListener(new ResultAdapter() {
                    public void resultAccepted(final ResultEvent e)
                         try {
                              FinalRuleResult r = (FinalRuleResult)(e.getSource());
                              System.out.println("Obtenido el resultado "+r);
                              String tags[] = r.getTags();
if(tags == null) return;
                    //comparacion de :::     
// in this point i want catch the word that was spoken in a string to evaluate the string in the sentences if                               
                              if(tags[0].equals("VOL"))
                                   JOptionPane.showMessageDialog(null,"has selecciuonado el volumen");
                                   jLabel1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("control/controltv+.gif")));
                                   enviar("s");     
                              if(tags[0].equals("CHANNEL"))
                                        JOptionPane.showMessageDialog(null,"QUIERES CAMBIAR CANAL???");
                                        jLabel1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("control/controlt0.gif")));
                                        enviar("c");
                              if(tags[0].equals("END"))
                              JOptionPane.showMessageDialog(null,"SESION DE RECONOCIMIENTO TERMINADA");
                              jLabel1.setIcon(new ImageIcon(getClass().getClassLoader().getResource("control/controlt1.gif")));
                              System.exit(-1);
                              else return;
                         } catch(Exception e1) {}
          } catch (Exception e) {
               e.printStackTrace();
               System.exit(-1); }
     }

I donot know about Java Speech API.
But it is possible to recognize with Sphinx API.
you get it from [http://cmusphinx.sourceforge.net/sphinx4/]

Similar Messages

  • Chrome did something. Insetad of all my Bookmarks, settings and Apps it's a fresh Chrome. Like the day it started. How do I restore the Chrome that was there?

    Chrome did something. Insetad of all my Bookmarks, settings and Apps it's a fresh Chrome. Like the day it started. Virgin, naked, nothing there.  How do I restore the Chrome that was there?

    Chrome 'syncs' your information to its servers, so you can restore this information when you sign into your account, regardless of what device you are using. As for the latter part of your comment, I am not really following. I don't have Chrome currently installed on my machine so I can not help you step by step. All I know is you must SIGN IN to your google account on chrome and check the chrome preferences.
    Google dashboard will show you all the information associated with your google account stored on their servers:
    Dashboard - Google

  • How I can erase the components that I have created in a content area?

    hello. Somebody knows how I can erase the components that I have created in a content area. I have created an area of content and the archives, categorias or perspective that I generate not let erase. The same it happens to me to the forms, reports and other components created under a certain application

    goto portal navigator --> content areas --> next to the content area --> click Edit Properties --> Items tab --> last button on the page is Purge..
    this should take care of it

  • Hi, you know how i can fix the problem that my iPhone5s not have any coverage in place? Please.

    Hi, you know how i can fix the problem that my iPhone5S not have any coverage in place?
    Please, and thanks.

    If it's out of warranty, Apple will replace your phone for $269.

  • How i can install the products  that i have in my contract on my laptop?

    how i can install the products  that i have in my contract on my laptop?

    Make sure your laptop meets the system specifications for the software.  Then download and install the CC manager program, sign in using your authorization code, and install the programs that your contract supports.

  • If you have 2 apple ids, how do you sign out of one and into the other so you can update the app that was purchased in the other account.  thanks

    If you purchased an app in one account and work mostly in another, how do you switch the purchased app account to update it?
    thanks

    You need to sign out and back in only if you're on your Mac and you want to update the iTunes data.  You'll see a notice saying that there are five (or so) updates but when you go to download them, they're not all present.  So you download them, sign out from one ID and sign back in with the other ID.  Then you can download the remaining ones.
    If you're downloading directly to the iPad, everything is transparent.  It does not matter what ID is configured in Settings.  The iPad automatically chooses the correct ID or IDs when updates are available.

  • How do i replace the data that was previously on an iphone?

    I connected my sister's iphone to a computer via USB to download some photos.  Her husband's iphone data was on the computer.  Instead of just presenting the option to open the folder to view files in trying to access her phone all of his data was downloaded to her phone.  All of her contacts, settings etc are no longer there on her phone.  Please help.

    Thank you KiltedTim.  She is not a typical "syncer" or computer/phone interface person so only a few times, if that, has her phone been "synced".  And the time that I synced it I was not presented the option for anything related to her husband's phone so I highly did not expect anything but simply upload options.  He possibly placed his info on her netbook since.  Everytime that I have interfaced any phone to a computer, including hers, a Blackberry, a Samsung, etc., the screen that lists the options including "Open Folder to View Files" comes up automatically.  My understanding of the system prompt to recognize her iphone as it did her husband's was that it would relate the iphone interface software for the upload not replace her data with his.

  • What happens if u delete a back up device how would it affect the device that was deleted

    Help please my moms phone is sinked to mine and I want to get rid of it do I don't have to see her calendar

    If you are both signed into the same iCloud account, don't delete anything or it will be deleted from her device too.  If you are not signed into the same iCloud account you can delete the data you don't want and it will not effect your mom's phone.
    You can check if you are both signed into the same account by going to Settings>iCloud and looking at the Account ID on your phone and hers.  If it matches, you're signed into the same account and will need to migrate to your own separate account before deleting anything.

  • From my pc, how i can see the cellphones that uses my Apple ID?

    Hello everyone, i am starting this new discussion for a need of help of my cellphone.
    Well first, i was rob, that means that a thief got my phone and my iphone is sincronized with my Apple ID, (locations on my iPhone were off) so if any of you could help me by managing my stolen iPhone from my computer by my Apple ID would be great and also made me happier.
    Thanks for who ever answers me.

    The only way to locate/disable/erase any lost/stolen iPhone/iPod Touch is through Find My Phone or a similar app. However, this requires that Find My Phone be setup/activated, on your phone, before it was lost/stolen. You would then login at iCloud.com & try to locate it. This requires the phone be turned on & have an Internet connection. There is no other way to locate a lost/stolen iPhone. Apple can't/won't help you, nor will your carrier. Report the loss to the Police, your carrier & Insurance company. Change all of your passwords.
    If your carrier offers Blacklisting & they Blacklist the phone, it will be unusable as a phone.
    If locked with a passcode, and running iOS 7.0, then phone cannot be activated or the passcode removed without knowing your Apple iD/Password. It will be nothing but a useless paperweight.
    If not running iOS 7.0, the phone can be forced into recovery mode & restored.

  • How do i change the name that was given to the folder located in /users

    when i bought this imac, the shopkeeper initialized it and entered my first name incorrectly it now appears mispelled as the title to the main folder located in /Users. when i open the window to access the info relative to this folder, the section 'Name & Extension' appears grayed out and i cannot change the mispelled name. anyone can help me find out how do i change this?

    There are  ways of changing the home folder name but I would strongly advise against it.
    Best way forward is to start over. You can create a new user with proper spelling of your name and make sure you assign administrator rights.
    You can do it in System Preferences / Users
    This is obviously only if you are fine with starting a new user profile and customising it.
    Let me know if you need detailed information step-by-step.
    TZ

  • Does any body know how i can fix the problem that i cant slide my wifi from on to off and it says wifi address n/a

    i cant even slide my wifi to on it wont let me and the wifi address says n/a

    iWork '08 & 09 installed from the retail disk or from the downloaded trial must be updated through Software Update. Those installations will not be recognized as installed by the Mac App Store. In Mountain Lion Software Update has been "rolled into" the Mac App Store. Choose Software Update from the Apple menu just like you always have & the Mac App Store will launch. Depending on what you have that needs updating you may see two sections in the MAS window.
    But, as always, if you're not running the latest versions of the iWork apps installed from a retail box or the downloaded trial & Software Update says your software is up to date, make sure the applications are where the installer initially put them. The updaters are very picky. If the location is not where the updater is programmed to look or if the folder doesn't have the name the updater looks for, it will not work. The applications cannot be renamed or moved. If you installed from the downloaded trial or the retail box, they must be in the iWork '08 folder in Applications. That iWork folder must be named iWork '08. If it doesn't have the '08 Software Update won't find them & the updaters won't work.
    If you are running Pages 3.0.3, then you do have the latest version of Pages from iWork '08. If you want to upgrade to iWork '09, you will need to purchase the new version, just like everyone else. The good news is that you can buy just the individual iWork apps - Keynote, Pages & Numbers - that you need or want for $20 US each from the Mac App Store & then install them on as many Macs as you need using the same Apple ID.

  • How i can catch de close ovent on a ShowDetailItem?

    I need ask if the user wants to close the DetailItem with a popup dialog. i use itemListener(ItemEvent itemEvent) in my MB but i can't stop the close action.
    Edited by: user12982724 on 10-feb-2012 10:46

    Ok, the requeriments has change, IF the user do a change, for example delete a row in a table (delete method of adf binding) and the user doesn't click un the save button and attends to close de browser windows HOW I CAN WARNING THE USER THAT THERE ARE CHANGES WICH ARE NOT SAVED????

  • I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    The application Acrobat provides no language translation capability.
    If you localize the language for OS, MS Office applications, Acrobat, etc to the desired language try again.
    Alternative: transfer a copy of content into a web based translation service (Bing or Google provides a free service).
    Transfer the output into a word processing program that is localized to the appropriate language.
    Do cleanup.
    Be well...

  • HT1212 I took the passcode lock off of my iPhone 5 and now I can't get on to my iPad. It is asking for the passcode and when I use the one that was set up it locks me out. How can I get past this?

    I have the iPhone 5 and with the new sofware update it added a passcode lock. Same for the iPad. I removed the passcode lock from my iPhone and now I can access my iPad. It is still asking for the four digit passcode. I tried using the one that was orgingally programed and it disables it every time. How can I get past this? I have tried to do a restore and it still takes me back to the lock screen. Please help!

    Force iPad into Recovery Mode. Follow step 1 to 6 very closely.
    http://support.apple.com/kb/HT1808
    Note: You may have to repeat the above a few times.

  • The voice that was on when I first set up my ipad came back on and now I have to double click to get into my apps and can't use my apps because her voice is always talking.  How do I make her voice go away and my IPAD work like it should.

    The voice that was on when I first set up my ipad came back on and now I have to double click to get into my apps and can't use my apps because her voice is talking.  How do I make the voice stop and my IPAD work again. 

    If you've turned VoiceOver on then see if triple-clicking the home button turns it off, and then change what Settings > General > Accessibility > Triple-Click Home is set to.
    Otherwise, via 'the touch to select double-tap to activate' process you need to go into Settings > General > Accessibility > VoiceOver and turn it off
    The manual (http://support.apple.com/manuals/#ipad) also says that you should be able to switch voice-over off by connecting to your computer's iTunes :
    Turn VoiceOver on or off in iTunes: Select iPad in the iTunes sidebar. In the Options section of the Summary pane, click Configure Universal Access. Select VoiceOver, then click OK.
    So select Configure Universal Access at the bottom of the Summary tab and set Seeing to Neither

Maybe you are looking for

  • Restriction of Payment to Vendor above Purchase Order Amount

    Hi Experts, I have a requirement where my user wants an error message to appear when a Payment to Vendor is made in excess of the PO Amount. An Information message appears when posting an advance payment through F-48 for the same but can I get a simi

  • I want to put photos on my ipad from a usb stick (with a connector)

    When I put the 8GB usb stick into the ipad (through a connector) I get the message Cannot use device. The connected USB device requires too much power. I am trying to load some photos on the ipad. Thanks

  • HCM in NetWeaver Trial Version

    Hi Experts, We are trying out with the Netweaver Trial version in our Team. ABAP and EP are working fine. As per the manual it is  mentioned that HCM is also included. But as such I see no signs of HCM in it and the T-codes does nt seem to exist. Is

  • How can I change the default font in Messages

    In Messages the default font for outgoing messages is set and grayed out so I cannot change it, how can I modifiy the font and it's size?

  • Need Optimized Solution to insert a table with 70 columns

    Hi, I need to insert almost 13 million records to a table which has 70 columns, and each column is a derived one.I have used the pl/sql tables to get all the 13 million records and process them, it takes 3 mins for 100 records. Any optimized solution