public synchronized void start() throws Exception { boolean needStartThread = false; if (thread != null && (thread.isTerminating() || outputStream == null)) { thread.terminate(); needStartThread = true; } if (VERBOSE) out("AudioCapture: start with OutputStream = " + outputStream); if ((thread == null || needStartThread) && outputStream != null) { // start thread thread = new CaptureThread(); thread.start(); } super.start(); }