Package edu.cmu.sphinx.frontend

Examples of edu.cmu.sphinx.frontend.DataEndSignal


        int sampleRate = 1000;

        input.add(new DataStartSignal(sampleRate));

        input.addAll(createDataInput(1000, 1000, sampleRate, 0)); // create one second of data sampled with 1kHz
        input.add(new DataEndSignal(0));

        Assert.assertTrue(hasIncreasingOrder(collectOutput(100), 1000));
    }
View Full Code Here


        int sampleRate = 1000;

        input.add(new DataStartSignal(sampleRate));

        input.addAll(createDataInput(600, 120, sampleRate, 0));
        input.add(new DataEndSignal(0));

        List<Data> output = collectOutput(100);

        Assert.assertEquals(output.size(), 6);
        Assert.assertEquals(201, ((DoubleData) output.get(2)).getFirstSampleNumber());
View Full Code Here

        int sampleRate = 1000;

        input.add(new DataStartSignal(sampleRate));
        input.addAll(createDataInput(500, 500, sampleRate, 0));
        input.addAll(createDataInput(300, 300, sampleRate, 500));
        input.add(new DataEndSignal(0));

        List<Data> output = collectOutput(250);

        Assert.assertEquals(output.size(), 3);
        Assert.assertEquals(501, ((DoubleData) output.get(2)).getFirstSampleNumber());
View Full Code Here

        input.add(new SpeechStartSignal(-1));
        input.addAll(createFeatVectors(0.5, sampleRate, 0, 10, 10));
        input.add(new SpeechEndSignal(-1));
        input.addAll(createFeatVectors(1, sampleRate, 0, 10, 10));

        input.add(new DataEndSignal(0));

        List<Data> result = collectOutput(ConfigurationManager.getInstance(NonSpeechDataFilter.class));

        Assert.assertTrue(result.size() == 54);
        Assert.assertTrue(result.get(0) instanceof DataStartSignal);
View Full Code Here

        input.addAll(createFeatVectors(0.1, sampleRate, 0, 10, 10));
        input.add(new SpeechEndSignal(-1));

        input.addAll(createFeatVectors(0.1, sampleRate, 0, 10, 10));

        input.add(new DataEndSignal(0));

        NonSpeechDataFilter nonSpeechDataFilter = ConfigurationManager.getInstance(NonSpeechDataFilter.class);
        List<Data> result = collectOutput(nonSpeechDataFilter);

        Assert.assertTrue(result.size() == 26);
View Full Code Here

    public void testMultipleEmptyAndNonemptySegments() throws DataProcessingException {
        int sampleRate = 1000;

        // process an empty segment
        input.add(new DataStartSignal(sampleRate));
        input.add(new DataEndSignal(sampleRate));

        // process a segment which contains a speech segment which is empty
        input.add(new DataStartSignal(sampleRate));
        input.add(new SpeechStartSignal(-1));
        input.add(new SpeechEndSignal(-1));
        input.add(new DataEndSignal(sampleRate));

        // process a segment which contains a speech segment which is empty but has some non-speech data around it
        input.add(new DataStartSignal(sampleRate));
        input.addAll(createFeatVectors(1, sampleRate, 0, 10, 10)); // create one second of data sampled with 1kHz
        input.add(new SpeechStartSignal(-1));
        input.add(new SpeechEndSignal(-1));
        input.addAll(createFeatVectors(1, sampleRate, 0, 10, 10)); // create one second of data sampled with 1kHz
        input.add(new DataEndSignal(sampleRate));

        // and now a some real segments
        input.add(new DataStartSignal(sampleRate));
        input.add(new SpeechStartSignal(-1));
        input.addAll(createFeatVectors(0.1, sampleRate, 0, 10, 10));
        input.add(new SpeechEndSignal(-1));
        input.add(new DataEndSignal(sampleRate));


        List<Data> result = collectOutput(ConfigurationManager.getInstance(NonSpeechDataFilter.class));

        Assert.assertTrue(result.size() == 24);
View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.frontend.DataEndSignal

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.