Package edu.cmu.sphinx.frontend.util

Examples of edu.cmu.sphinx.frontend.util.StreamDataSource


     * @param args argv[0] : The name of an audio file argv[1] : SphinxProperties file
     */
    static public void main(String[] args) {
        FrontEnd frontEnd;
        FrontEnd cepstrumFrontEnd;
        StreamDataSource dataSource;
        StreamDataSource cepstrumDataSource;

        prefs = Preferences.userRoot().node(PREFS_CONTEXT);
        filename = prefs.get(FILENAME_PREFERENCE, "untitled.raw");
        file = new File(filename);

View Full Code Here


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

        Recognizer recognizer = cm.lookup("recognizer");
        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());

        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

TOP

Related Classes of edu.cmu.sphinx.frontend.util.StreamDataSource

Copyright © 2018 www.massapicom. 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.