open Audio Sound Line - Java javax.sound.sampled

Java examples for javax.sound.sampled:Audio

Description

open Audio Sound Line

Demo Code


//package com.java2s;

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

public class Main {
    public static boolean open(Line line) {
        if (line.isOpen())
            return false;
        try {//from w ww . ja v a2 s. c  o m
            line.open();
        } catch (LineUnavailableException ex) {
            return false;
        }
        return true;
    }
}

Related Tutorials