Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void extractFeatures(){
- DataModel dm = new DataModel("C:/Users/Gasper/workspace/cmrlji/features.xml",null);
- Batch batch = new Batch();
- batch.setSettings(512, 0.0, 16000.0, true, false, true, 2);
- //DataModel dm = batch.getDataModel();
- //System.out.println("WTF "+dm);
- HashMap<String, Boolean> activated = new HashMap<String, Boolean>();
- activated.put("Spectral Centroid", true);
- activated.put("Spectral Rolloff Point", true);
- activated.put("Spectral Flux", true);
- activated.put("Compactness", true);
- HashMap<String, String[]> attributes = new HashMap<String, String[]>();
- /*
- attributes.put("Spectral Centroid", value);
- attributes.put("Spectral Rolloff Point", valueDouble);
- attributes.put("Spectral Flux", value);
- attributes.put("Compactness", value);
- */
- batch.setFeatures(activated, attributes);
- RecordingInfo[][] recording_table = new RecordingInfo[1][1];
- RecordingInfo recording = new RecordingInfo("C:/Users/Gasper/Downloads/beeTEST.wav");
- recording_table[0][0] = recording;
- batch.setRecording(new RecordingInfo[]{recording});
- int[] windowSize = {512};
- double[] windowOverlap = {0.0};
- double[] sampleRate = {16.0};
- boolean[] normalise = {true};
- boolean[] perWindow = {true};
- boolean[] overall = {false};
- String[] destinationFeatDef = {"C:/Users/Gasper/Desktop/jAudio"};
- String[] destinationFeatValues = {"C:/Users/Gasper/Desktop/jAudio"};
- int[] outputType = {2};
- System.out.println("TEST1");
- batch.applySettings(
- recording_table,
- windowSize,
- windowOverlap,
- sampleRate,
- normalise,
- perWindow,
- overall,
- destinationFeatDef,
- destinationFeatValues,
- outputType
- );
- System.out.println("TEST2");
- try {
- System.out.println("TEST3");
- batch.execute();
- System.out.println("TEST4");
- } catch (Exception e) {
- System.out.println("We tried boys, but we failed.");
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement