public void run() { try { sourceDataLine.flush(); int len; while ((len = audioInputStream.read(tempBuffer, 0, tempBuffer.length)) != -1) { if (breaked_out) { break; } if (len > 0) { sourceDataLine.write(tempBuffer, 0, len); } } //breaked or stopped sourceDataLine.flush(); sourceDataLine.close(); breaked = true; } catch (Exception e) { log.error("Thread error: " + e); } } }
@Override public void onAudioFlush() { if (audioLine != null) audioLine.flush(); }
@Override public void flush () { dataLine.flush(); }
@Override public void flush () { dataLine.flush(); }
@Override public void flush () { dataLine.flush(); }
@Override public void flush () { dataLine.flush(); }
@Override public void flush() { if( null != auline ) { playRequested = false; auline.stop(); auline.flush(); } }
@Override public void flush() { if( null != auline ) { playRequested = false; auline.stop(); auline.flush(); } }
@Override public void onInactive() { if (audioLine != null) { audioLine.flush(); audioLine.close(); audioLine = null; } }
public void flush() { if (line != null && line.isOpen()) line.flush(); }
public void seek(int position) { if (currentTrack != null) { audio.flush(); spotify.seek(position); seekCallback(position); } }
private synchronized void dispose() { if (this.dataLine != null) { this.dataLine.stop(); this.dataLine.flush(); this.dataLine.close(); } this.dataLine = null; this.gainControl = null; this.panControl = null; }
public void close() { finished = true; // try // { // iothread.join(10); // } // catch (InterruptedException e) // { // e.printStackTrace(); // } iothread = null; try { ais.close(); } catch ( IOException e ) { } line.flush(); line.close(); }
/** * Dequeues all previously queued data. */ @Override public void flush() { // only a streaming source can be flushed: // Only streaming sources process buffers: if( channelType != SoundSystemConfig.TYPE_STREAMING ) return; // Make sure we have a SourceDataLine: if( errorCheck( sourceDataLine == null, "SourceDataLine null in method 'flush'." ) ) return; sourceDataLine.stop(); sourceDataLine.flush(); sourceDataLine.drain(); streamBuffers.clear(); processed = 0; }
private void killTheLine() { if(myOutputLine != null && myOutputLine.isOpen()) { if(myOutputLine.isActive()) { myOutputLine.stop(); } myOutputLine.flush(); myOutputLine.close(); } } }
line.flush(); line.close(); line = null;
/** * @see io.github.amyassist.amy.core.audio.environment.AbstractAudioEnvironment#stop() */ @Override public void stop() { super.stop(); if (this.sdl.isActive()) { this.sdl.flush(); this.sdl.stop(); } if (this.tdl.isActive()) { this.tdl.flush(); this.tdl.stop(); } try { this.sdl.close(); } catch (RuntimeException e) {//NOSONAR // Needed because of a pulse audio bug, where close throws weird exceptions } try { this.tdl.close(); } catch (RuntimeException e) {//NOSONAR // Needed because of a pulse audio bug, where close throws weird exceptions } } }
buffer = null; line.stop(); line.flush();
line.flush(); line.close(); line = null;
sourceDataLine.flush(); sourceDataLine.close();