Code example for SourceDataLine

Methods: startopen

0
        try { 
            Line line = AudioSystem.getLine(getSourceLineInfo());
            if (line instanceof SourceDataLine) {
                source = (SourceDataLine) line;
                //source.open(fmt, millisecondsToBytes(fmt, 2000)); 
                source.open(fmt);
                /* 
                if (source.isControlSupported(FloatControl.Type.MASTER_GAIN)) 
                { 
                FloatControl c = (FloatControl)source.getControl(FloatControl.Type.MASTER_GAIN); 
                c.setValue(c.getMaximum()); 
                }*/ 
                if(start) {
                    source.start();  
                } 
            } 
        } catch (RuntimeException ex) {
            t = ex;
        } catch (LinkageError ex) {
            t = ex;