Code example for SourceDataLine

Methods: close

0
        return (int) (time * (fmt.getSampleRate() * fmt.getChannels() * fmt.getSampleSizeInBits()) / 8000.0);
    } 
 
    protected void closeImpl() { 
        if (source != null) {
            source.close();
        } 
    } 
 
    protected void writeImpl(short[] samples, int offs, int len)
            throws JavaLayerException { 
        if (source == null) {
            createSource(); 
        } 
 
        byte[] b = toByteArray(samples, offs, len);
        source.write(b, 0, len * 2);
    } 
 
    protected byte[] getByteArray(int length) {
Experience pair programming with AI  Get Codota for Java