Code example for SourceDataLine

Methods: stop

0
     
     
 
    public void cancel() { 
        if (line != null)
            line.stop();
        exitRequested = true;
    } 
 
    public SourceDataLine getLine() {
        return line;
    } 
 
    public void run() { 
        status = Status.PLAYING;
        AudioFormat audioFormat = ais.getFormat();
        if (audioFormat.getChannels() == 1) {
            if (outputMode != MONO) { // mono -> convert to stereo
                ais = new StereoAudioInputStream(ais, outputMode);
                audioFormat = ais.getFormat();