Package edu.cmu.sphinx.api

Examples of edu.cmu.sphinx.api.SpeechAligner.align()


     * @param args acoustic model, dictionary, audio file, text
     */
    public static void main(String args[]) throws Exception {
        File file = new File(args[2]);
        SpeechAligner aligner = new SpeechAligner(args[0], args[1], null);
        splitStream(file, aligner.align(file.toURI().toURL(), args[3]));
    }

    private static void splitStream(File inFile, List<WordResult> results)
        throws UnsupportedAudioFileException, IOException
    {
View Full Code Here


        String dictionaryPath = (args.length > 3) ? args[3] : DICTIONARY_PATH;
        String g2pPath = (args.length > 4) ? args[4] : null;
        SpeechAligner aligner =
                new SpeechAligner(acousticModelPath, dictionaryPath, g2pPath);

        List<WordResult> results = aligner.align(audioUrl, transcript);
        List<String> stringResults = new ArrayList<String>();
        for (WordResult wr : results) {
            stringResults.add(wr.getWord().getSpelling());
        }
       
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.