Code example for SourceDataLine

Methods: open

0
     
    static public SourceDataLine getLine(AudioFormat audioFormat) throws LineUnavailableException {
    	SourceDataLine res = null;
    	DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
    	res = (SourceDataLine) AudioSystem.getLine(info);
    	res.open(audioFormat);
    	return res;
    }     
	     
    static public Duration getDuration(String filename) {
        if ((filename == null) || (filename.equals("")))
        	return new Duration(0); 
        Duration result = null; 
        try {           
        	FileLockManager.startFileRead(filename);
        	if (VideoUtil.isSupportedVideoFileType(filename) && !AudioUtil.isSupportedAudioFileType(filename)) {
        		return VideoUtil.getDuration(filename);
        	} 
        	if (result == null) { 
	        	if (getAudioFileType(filename) == AUDIO_FILE_TYPE_OGG)
Experience pair programming with AI  Get Codota for Java