Package edu.cmu.sphinx.util.props

Examples of edu.cmu.sphinx.util.props.ConfigurationManager.lookup()


      cm = new ConfigurationManager(args[0]);
    } 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()) {
View Full Code Here


    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.");
      recognizer.deallocate();
      System.exit(1);
    }
View Full Code Here

    public void onStart() {
        //setGrammar();
        ConfigurationManager cm;
        cm = new ConfigurationManager(Sphinx.class.getResource("sphinx.config.xml"));
        try {
            recognizer = (Recognizer) cm.lookup("recognizer");
            recognizer.allocate();
        } catch (Exception e) {
            e.printStackTrace();
        }
        // start the microphone or exit if the programm if this is not possible
View Full Code Here

            recognizer.allocate();
        } catch (Exception e) {
            e.printStackTrace();
        }
        // start the microphone or exit if the programm if this is not possible
        Microphone microphone = (Microphone) cm.lookup("microphone");
        if (microphone == null || !microphone.startRecording()) {
            System.out.println("Cannot start microphone. Check if connected.");
            recognizer.deallocate();
        }
        System.out.println("Say: (turn on | turn off) ( kitchen light | livingroom light | light one | light two )");
View Full Code Here

      //Clone necessario, istanzia un nuovo Configuration Manager per ogni process()
      //in caso di più sphinxAE in esecuzione, le risorse vengono duplicate da quello
      //creato nel metodo inizilize() per non reimpostare tutti i parametri
      ConfigurationManager cm = this.cm.clone();
     
      recognizer = (Recognizer) cm.lookup("recognizer");
     
      List<File> batch = new ArrayList<File>();
      ArrayList<Integer> beginAnnot = new ArrayList<Integer>();
      ArrayList<Integer> endAnnot = new ArrayList<Integer>();
      ArrayList<Long> beginTimeAnnot = new ArrayList<Long>();
View Full Code Here

     
  //    getContext().getLogger().log("CF File is " + ConfigFile);
     
  //    if(audioIt.hasNext())
     
      ConcatAudioFileDataSource data = (ConcatAudioFileDataSource) cm.lookup("dataSource");
     
      for(String i: audio.getAudioPath().toArray())
        batch.add(new File(i));
     
      data.setBatchFiles(batch);
View Full Code Here

        if (argv.length == 1) {
          String configFile = argv[0];
       
          ConfigurationManager cm = new ConfigurationManager(configFile);
          Trainer trainer = (Trainer)cm.lookup (context);
          trainer.processStages(context);
        }
    }
}
View Full Code Here

            } else {
                url = AudioTool.class.getResource("spectrogram.config.xml");
            }
            ConfigurationManager cm = new ConfigurationManager(url);

            recorder = (Microphone) cm.lookup(MICROPHONE);
            recorder.initialize();
            audio = new AudioData();

            frontEnd = (FrontEnd) cm.lookup(FRONT_END);
            dataSource = (StreamDataSource) cm.lookup(DATA_SOURCE);
View Full Code Here

            recorder = (Microphone) cm.lookup(MICROPHONE);
            recorder.initialize();
            audio = new AudioData();

            frontEnd = (FrontEnd) cm.lookup(FRONT_END);
            dataSource = (StreamDataSource) cm.lookup(DATA_SOURCE);
            cepstrumFrontEnd = (FrontEnd) cm.lookup(CESPTRUM_FRONT_END);
            cepstrumDataSource = (StreamDataSource) cm.lookup(CEPSTRUM_DATA_SOURCE);

View Full Code Here

            recorder = (Microphone) cm.lookup(MICROPHONE);
            recorder.initialize();
            audio = new AudioData();

            frontEnd = (FrontEnd) cm.lookup(FRONT_END);
            dataSource = (StreamDataSource) cm.lookup(DATA_SOURCE);
            cepstrumFrontEnd = (FrontEnd) cm.lookup(CESPTRUM_FRONT_END);
            cepstrumDataSource = (StreamDataSource) cm.lookup(CEPSTRUM_DATA_SOURCE);


            PropertySheet ps = cm.getPropertySheet(WINDOWER);
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.