Code example for SourceDataLine

Methods: flushisRunningstop

0
    /** 
     * Stops the current sourceDataLine from writing. This should be called when the  
     * stream has been paused with intent to reopen it. 
     */ 
    public void stopSourceDataLine(){ 
        if( sourceDataLine != null && sourceDataLine.isRunning()){
            sourceDataLine.flush();
            sourceDataLine.stop();
        } 
    } 
     
    /** 
     * @return frame position in the current song being played 
     */ 
    public int getEncodedStreamPosition() { 
        return (int)(totalLength - available());
    } 
 
    /** 
     * Seeks to a current position in the song.