Results 1 to 2 of 2
  1. #1
    satishfied is offline Member
    Join Date
    Dec 2015
    Posts
    1
    Rep Power
    0

    Default launch the JAVA Client

    Quote Originally Posted by pennaverde View Post
    I want to create a speech recognition app, and i want move the code of main class in new function(inside java), then(after converting the file in dll and import in c# prjct) call that function from c# code

    this is the code hello world to edit
    what do you think? it's possible?(obviusly i don't have change yet)

    Java Code:
    package edu.cmu.sphinx.demo.helloworld;
    
    import edu.cmu.sphinx.frontend.util.Microphone;
    import edu.cmu.sphinx.recognizer.Recognizer;
    import edu.cmu.sphinx.result.Result;
    import edu.cmu.sphinx.util.props.ConfigurationManager;
    
    /**
     * A simple HelloWorld demo showing a simple speech application built using Sphinx-4. This application uses the Sphinx-4
     * endpointer, which automatically segments incoming audio into utterances and silences.
     */
    public class HelloWorld {
    	public static String whatTalk;
    	public static Boolean isRecognize = false;
        public static void main(String[] args) {
        	
            ConfigurationManager cm;
    
            if (args.length > 0) {
                cm = new ConfigurationManager(args[0]);
            } else {
                cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml"));
            }
    
            Recognizer recognizer = (Recognizer) cm.lookup("recognizer");
            recognizer.allocate();
    
            // start the microphone or exit if the programm if this is not possible
            Microphone microphone = (Microphone) cm.lookup("microphone");
            if (!microphone.startRecording()) {
                System.out.println("Cannot start microphone.");
                recognizer.deallocate();
                System.exit(1);
            }
    
            System.out.println("Say: (fire ball | hello | hi | good bye | bye)");
    
            // loop the recognition until the programm exits.
            while (true) {
                System.out.println("Start speaking. Press Ctrl-C to quit.\n");
    
                Result result = recognizer.recognize();
    
                if (result != null) {
                    String resultText = result.getBestFinalResultNoFiller();
                    whatTalk = resultText;              //assign what i've talking at string var
                    isRecognize = true;                  //tells the C # code that I'm talking
                    System.out.println("You said: " + resultText + '\n');
                    isRecognize = false;                 //end of tell
                } else {
                    System.out.println("I can't hear what you said.\n");
                }
            }
        }
    }

    How did you solved the issue. I want to do the same I want to make Windows Store App which will use the Starting method from JAR to start the internal JAVA web Server and launch the JAVA Client from that.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: launch the JAVA Client

    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 7
    Last Post: 12-05-2013, 12:09 PM
  2. Replies: 6
    Last Post: 12-05-2013, 11:59 AM
  3. JRE Will not launch Java Programs
    By AllForNothing in forum Java Applets
    Replies: 6
    Last Post: 09-04-2012, 09:38 PM
  4. How to launch two Java programs?
    By 260191894 in forum Advanced Java
    Replies: 1
    Last Post: 07-10-2012, 10:51 PM
  5. Cannot launch Java application
    By Coolcambo in forum New To Java
    Replies: 1
    Last Post: 11-24-2011, 02:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •