get Audio Mixer Line If Available - Java javax.sound.sampled

Java examples for javax.sound.sampled:Audio

Description

get Audio Mixer Line If Available

Demo Code


//package com.java2s;

import javax.sound.sampled.Line;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer;

public class Main {
    public static Line getLineIfAvailable(Mixer mixer, Line.Info lineInfo) {
        try {// w w  w. j av a2 s.c  o m
            return mixer.getLine(lineInfo);
        } catch (LineUnavailableException ex) {
            return null;
        }
    }
}

Related Tutorials