package recognitotest; import java.io.File; import java.io.IOException; import java.util.List; import javax.sound.sampled.UnsupportedAudioFileException; import com.bitsinharmony.recognito.MatchResult; import com.bitsinharmony.recognito.Recognito; import com.bitsinharmony.recognito.VoicePrint; public class Test { public static void main(String args[]) { Recognito recognito = new Recognito<>(44100.0f); double[] features1 = { 0.0, 0.8065468673436712, -1.0, 0.9737978084537816, -0.7981489447346217, 0.5762709064870121, -0.35894611506268653, 0.14750330679167015, 0.02818692858260461, -0.14174691288733965, 0.1724360507414804, -0.13003189630232234, 0.0745190841174061, -0.016660602126182554, -0.020947895779968383, 0.029600981938353015, -0.022918917832539094, 0.011954253517904663, -0.002643608770961939, -8.373363727713565E-4}; double[] features2 = { 0.0, 0.6047122447416658, -0.8636693362031104, 1.0, -0.9580753345349828, 0.7517565924971663, -0.4690766679177552, 0.1755114357842358, 0.04278572755689291, -0.15743926303372144, 0.18931924790526886, -0.14183079992797687, 0.07874322907214176, -0.03136976062605449, 0.007122254001561953, -0.012261552968689901, 0.02144818887039361, -0.021011969127196634, 0.01268865400298537, -0.004677895538654409 }; double[] features3 = { 0.0, 0.4860874260289257, -0.7437520957708822, 0.9452460011387248, -1.0, 0.8991176249824595, -0.6419824303406305, 0.32939936135276393, -0.03575508945984053, -0.1650650835709724, 0.24182364094019312, -0.22046283976269954, 0.1329294724258774, -0.04467340849489117, -0.013191052023408745, 0.034893192645618874, -0.02394812731546294, 0.010353312762622375, 5.822522027845542E-4, -0.0034639912728463627}; VoicePrint print1 = recognito.createVoicePrint("IZ", features1); VoicePrint print2 = recognito.createVoicePrint("PD", features2); VoicePrint print3 = recognito.createVoicePrint("JH", features3); List> matches = null; try { matches = recognito.identify(new File("wavfile.wav")); } catch (UnsupportedAudioFileException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } for (MatchResult match : matches) { System.out.println("Identified:" + match.getKey() + " : ratio = " + match.getLikelihoodRatio()); } } }