public void extractFeatures() {
        featureHop = 1024;
    	//set up the basic network
    	AudioContext ac = new AudioContext(featureHop, -1, audioFormat);
    	ac.setRealTime(false);
    	SamplePlayer sp = new SamplePlayer(ac, this);
    	sp.setEndListener(new AudioContextStopTrigger(ac));
       	PowerSpectrum ps = new PowerSpectrum(ac);
    	ps.addInput(sp);
    	sp.addDependent(ps);
    	ps.setNumFeatures(10);
    	ac.getRoot().addInput(sp);
    	ps.accumulate(true);
    	//run and extract
    	ac.logTime(true);
    	ac.runNonRealTime();
    	System.out.println("finished analysis");
        float[][] allFeatures = new float[ps.getAccumulatedFeatures().size()][];
    	int totalFeatures = 10;
    	for(int i = 0; i < ps.getAccumulatedFeatures().size(); i++) {
    		float[] newFeatureFrame = new float[totalFeatures]; 
    		int featureIndex = 0;
    		float[] powerBin = ps.getAccumulatedFeatures().get(i);
    		for(int j = 0; j < powerBin.length; j++) {
    			newFeatureFrame[featureIndex++] = powerBin[j];
    		}
    		allFeatures[i] = newFeatureFrame;
    	}
    	features.put("all", allFeatures);
    	if(name != null) {
    		try {
    			writeFeatures();
    		} catch(Exception e) {
    			e.printStackTrace();
    		}
    	}
    }