ByteArrayOutputStream out = new ByteArrayOutputStream(); running = true; int n = 0; byte[] buffer = new byte[(int) 1024]; try { while (running) { n++; if (n > 200000){break;} int count = 0; count = outDinSound.read(buffer, 0, 1024); if (count > 0) {out.write(buffer, 0, count);} } byte b[] = out.toByteArray(); <pre>final int totalSize = b.length; int amountPossible = totalSize / 1024; System.out.println("Frequencies captured: "+totalSize+" "+amountPossible+" * 1024"); System.out.println("_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _"); Complex[][] results = new Complex[amountPossible][]; System.out.println(" * * * STARTING ANALYSIS * * *"); for (int times = 0; times < amountPossible; times++) { Complex[] complex = new Complex[1024]; for (int i = 0; i < 1024; i++) { complex[i] = new Complex(b[(times * 1024) + i], 0); } results[times] = FFT.fft(complex); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)