/** * Wait for the SharedOutputBuffer to become available, write audio data to it. */ public void run() { this.logger = MaryUtils.getLogger(Thread.currentThread().getName()); // We must wait until produceContent() is called: while (out == null) { synchronized (mutex) { try { mutex.wait(); } catch (InterruptedException e) { } } } assert out != null; ContentOutputStream outStream = new ContentOutputStream(out); try { AudioSystem.write(audio, audioType, outStream); outStream.flush(); outStream.close(); logger.info("Finished writing output"); } catch (IOException ioe) { logger.info("Cannot write output, client seems to have disconnected. ", ioe); maryRequest.abort(); } } }
/** * Wait for the SharedOutputBuffer to become available, write audio data to it. */ public void run() { this.logger = MaryUtils.getLogger(Thread.currentThread().getName()); // We must wait until produceContent() is called: while (out == null) { synchronized (mutex) { try { mutex.wait(); } catch (InterruptedException e) { } } } assert out != null; ContentOutputStream outStream = new ContentOutputStream(out); try { AudioSystem.write(audio, audioType, outStream); outStream.flush(); outStream.close(); logger.info("Finished writing output"); } catch (IOException ioe) { logger.info("Cannot write output, client seems to have disconnected. ", ioe); maryRequest.abort(); } } }
/** * Wait for the SharedOutputBuffer to become available, write audio data to it. */ public void run() { this.logger = MaryUtils.getLogger(Thread.currentThread().getName()); // We must wait until produceContent() is called: while (out == null) { synchronized (mutex) { try { mutex.wait(); } catch (InterruptedException e) { } } } assert out != null; ContentOutputStream outStream = new ContentOutputStream(out); try { AudioSystem.write(audio, audioType, outStream); outStream.flush(); outStream.close(); logger.info("Finished writing output"); } catch (IOException ioe) { logger.info("Cannot write output, client seems to have disconnected. ", ioe); maryRequest.abort(); } } }