Anonymous - 2012-03-21

Code:

import static marf.MARF.*;
public class AudioRecognizer {
    final static String TRAINING_HELLO = "training_hello_8K_16Bit.wav";
    final static String TESTING_HELLO = "testing_hello_8K_16Bit.wav";
    final static String TESTING_BYE = "testing_by_8K_16Bit.wav";
    public static void main(String[] args) throws Exception {
        setSampleFile(TRAINING_HELLO);
        setSampleFormat(WAV);
        setPreprocessingMethod(RAW);
        setFeatureExtractionMethod(FFT);
        setClassificationMethod(EUCLIDEAN_DISTANCE);
        int currentSubject = 1234;
        setCurrentSubject(currentSubject);
        train();
        setSampleFile(TESTING_HELLO);
        recognize();
        double outcome = getResult().getOutcome();
        System.out.println("testing_hello outcome: " + outcome);
        int resultID = queryResultID();
        System.out.println("Are the two audio same?");
        System.out.println(currentSubject == resultID);
        setSampleFile(TESTING_BYE);
        recognize();
        outcome = getResult().getOutcome();
        System.out.println("testing_bye outcome: " + outcome);
        resultID = queryResultID();
        System.out.println("Are the two audio same?");
        System.out.println(currentSubject == resultID);
    }
}

Output:

StorageManager.restore() --- file not found: "marf.Storage.TrainingSet.0.0.107.301.512.gzbin", marf.Storage.TrainingSet.0.0.107.301.512.gzbin (No such file or directory)
Creating one now...
testing_hello outcome: 1.1992869338362822
Are the two audio same?
true
testing_hello outcome: 11.106793776233202
Are the two audio same?
true