Code example for SourceDataLine

Methods: drainclose

0
   
  @Override 
  protected void finalize() throws Throwable {
    try { 
      // close the sourceDataLine properly when this object is garbage collected 
      sourceDataLine.drain();
      sourceDataLine.close();      
    } finally { 
      super.finalize(); 
    } 
  } 
 
  /** 
   * Converts a float audio array [-1,1] to an interleaved array of 16-bit samples 
   * in little-endian (low-byte, high-byte) format. 
   */ 
  private byte[] floatsToBytes(float[][] fData, byte[] bData) {
    int index = 0;
    for (int i = 0; i < blockSize; i++) {
      for (int j = 0; j < numAudioOutputs; j++) {
Contextual code suggestions in your IDE  Get Codota for Java