Package edu.cmu.sphinx.recognizer

Examples of edu.cmu.sphinx.recognizer.Recognizer.allocate()


    } else {
      cm = new ConfigurationManager(HarryPotter.class.getResource("harry.config.xml"));
    }

    final 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.");
View Full Code Here


      for(String i: audio.getAudioPath().toArray())
        batch.add(new File(i));
     
      data.setBatchFiles(batch);
     
      recognizer.allocate();
     
      getContext().getLogger().log(Level.INFO, "Start recognition of " + audio.getAudioPath().toString(0));
      Long comp1 = System.currentTimeMillis();
     
      while((result = recognizer.recognize()) != null){
View Full Code Here

        StreamDataSource dataSource = cm.lookup(StreamDataSource.class);

        AudioInputStream ais = getAudioInputStream(audioFileURL);
        dataSource.setInputStream(ais);

        recognizer.allocate();
        Lattice lattice = new Lattice(recognizer.recognize());

        cm = new ConfigurationManager(configURL);
        setProperty(cm, "keepAllTokens", "true");
        setProperty(cm, "trigramModel", "location", lm.toString());
View Full Code Here

        cm = new ConfigurationManager(configURL);
        setProperty(cm, "keepAllTokens", "true");
        setProperty(cm, "trigramModel", "location", lm.toString());

        recognizer = cm.lookup("recognizer");
        recognizer.allocate();
        dataSource = cm.lookup(StreamDataSource.class);
        dataSource.setInputStream(getAudioInputStream(audioFileURL));
        Lattice allLattice = new Lattice(recognizer.recognize());

        assertTrue(lattice.isEquivalent(allLattice));
View Full Code Here

            Recognizer recognizer = (Recognizer) cm.lookup("recognizer");
            Microphone microphone = (Microphone) cm.lookup("microphone");

   
      /* allocate the resource necessary for the recognizer */
            recognizer.allocate();
   
      /* the microphone will keep recording until the program exits */
            if (microphone.startRecording()) {

                System.out.println
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.