public void open(String filename,int auIndex) {
    int EXTERNAL_BUFFER_SIZE = 524288;

    URL soundFile = this.getClass().getClassLoader()
        .getResource("Sound/"+filename);

    AudioInputStream audioInputStream = null;
    try {
      audioInputStream = AudioSystem.getAudioInputStream(soundFile);
    } catch (Exception e) {
      e.printStackTrace();
      return;
    }

    AudioFormat format = audioInputStream.getFormat();

    // Describe a desired line
    DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);




    try {
      auline[auIndex] = (SourceDataLine) AudioSystem.getLine(info);

      // Opens the line with the specified format,
      // causing the line to acquire any required
      // system resources and become operational.
      auline[auIndex].open(format);
    } catch (Exception e) {
      e.printStackTrace();
      return;
    }

    // Allows a line to engage in data I/O
    auline[auIndex].flush();
    auline[auIndex].start();

	
    int nBytesRead = 0;
    byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
    
    try {
      while (nBytesRead != -1) {
        nBytesRead = audioInputStream.read(abData, 0, abData.length);
        if (nBytesRead >= 0) {
          // Writes audio data to the mixer via this source data line
          // NOTE : A mixer is an audio device with one or more lines
          auline[auIndex].write(abData, 0, nBytesRead);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
      return;
    } 
    finally {
      // Drains queued data from the line
      // by continuing data I/O until the
      // data line's internal buffer has been emptied
      auline[auIndex].drain();

      // Closes the line, indicating that any system
      // resources in use by the line can be released
      auline[auIndex].close();
    }

  }