Here you can find the source of closeDataLine(final SourceDataLine line, final AudioInputStream ais)
public static void closeDataLine(final SourceDataLine line, final AudioInputStream ais) throws IOException
//package com.java2s; import java.io.IOException; import javax.sound.sampled.*; public class Main { public static void closeDataLine(final SourceDataLine line, final AudioInputStream ais) throws IOException { line.drain();// w ww . j a v a2 s . c om line.stop(); line.close(); ais.close(); } }