Code example for SourceDataLine

Methods: startopen

0
    Throwable t = null;
    try { 
      Line line = AudioSystem.getLine(getSourceLineInfo());
      if (line instanceof SourceDataLine) {
        source = (SourceDataLine) line;
        source.open(audioFormat);
        source.start();
      } 
    } 
    catch (Throwable ex) {
      t = ex;
    } 
    if (source == null)
      throw new JavaLayerException("Cannot obtain source audio line", t);
  } 
 
  protected void closeImpl() { 
    if (source != null) {
      source.close();
    } 
Connect your IDE to all the code out there  Get Codota for Java