Advertisement
Guest User

Untitled

a guest
Feb 16th, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | None | 0 0
  1. public static void extractFeatures(){
  2.         Batch batch = new Batch();
  3.         DataModel dm = batch.getDataModel();
  4.         dm.
  5.         System.out.println("WTF "+dm);
  6.        
  7.         HashMap<String, Boolean> activated = new HashMap<String, Boolean>();
  8.         activated.put("Spectral Centroid", true);
  9.         activated.put("Spectral Rolloff Point", true);
  10.         activated.put("Spectral Flux", true);
  11.         activated.put("Compactness", true);
  12.        
  13.         HashMap<String, String[]> attributes = new HashMap<String, String[]>();
  14.         /*
  15.         attributes.put("Spectral Centroid", value);
  16.         attributes.put("Spectral Rolloff Point", valueDouble);
  17.         attributes.put("Spectral Flux", value);
  18.         attributes.put("Compactness", value);
  19.         */
  20.        
  21.        
  22.         batch.setFeatures(activated, attributes);
  23.        
  24.         RecordingInfo[][] recording_table = new RecordingInfo[1][1];
  25.         RecordingInfo recording = new RecordingInfo("C:/Users/Gasper/Downloads/beeTEST.wav");
  26.         recording_table[0][0] = recording;
  27.        
  28.         int[] windowSize = {512};
  29.         double[] windowOverlap = {0.0};
  30.         double[] sampleRate = {16.0};
  31.         boolean[] normalise = {true};
  32.         boolean[] perWindow = {true};
  33.         boolean[] overall = {false};
  34.         String[] destinationFeatDef = {"C:/Users/Gasper/Desktop/jAudio"};
  35.         String[] destinationFeatValues = {"C:/Users/Gasper/Desktop/jAudio"};
  36.         int[] outputType = {2};
  37.         System.out.println("TEST1");
  38.        
  39.         batch.applySettings(
  40.                 recording_table,
  41.                 windowSize,
  42.                 windowOverlap,
  43.                 sampleRate,
  44.                 normalise,
  45.                 perWindow,
  46.                 overall,
  47.                 destinationFeatDef,
  48.                 destinationFeatValues,
  49.                 outputType
  50.                 );
  51.         System.out.println("TEST2");
  52.         try {
  53.             System.out.println("TEST3");
  54.             batch.execute();
  55.             System.out.println("TEST4");
  56.         } catch (Exception e) {
  57.             System.out.println("We tried boys, but we failed.");
  58.             e.printStackTrace();
  59.         }
  60.        
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement