Code example for SourceDataLine

Methods: start

0
    public void pause() { 
        line.stop();
    } 
 
    public void resume() { 
        line.start();
    } 
 
    public void flush() { 
        line.flush();
    } 
 
    public void drain() { 
        line.drain();
    } 
 
    public void write(ByteBuffer sound) {
        int written;
        if (sound.hasArray()) {
            written = line.write(sound.array(), sound.arrayOffset() + sound.position(), sound.remaining());