lib 1400132 // spectro edit compiled for Java 8 import net.bluecow.spectro.Clip; static BWImage wavToFrequencyImage(File wav) ctex { Clip clip = Clip.newInstance(wav); int w = clip.getFrameCount(), h = clip.getFrameFreqSamples(); int h2 = min(h, 250); BWImage img = new(w, h2); Rectangle region = new(0, 0, w, h); //toClipCoords(region, clip); region.y = clip.getFrameFreqSamples() - (region.y + region.height); int endCol = region.x + region.width; int endRow = min(region.y + region.height, h2); for (int col = region.x; col < endCol; col++) { net.bluecow.spectro.Frame f = clip.getFrame(col); for (int row = region.y; row < endRow; row++) img.setPixel(col, h2-1-row, (float) f.getReal(row)); } ret img; }