Java Code Examples for javax.sound.sampled.LineUnavailableException

The following are top voted examples for showing how to use
javax.sound.sampled.LineUnavailableException. These examples are extracted from open source projects.
You can vote up the examples you like and your votes will be used in our system to generate
more good examples.

public void open() throws LineUnavailableException {
synchronized (mixer) {
// if the line is not currently open, try to open it with this format and buffer size
if (!isOpen()) {
if (Printer.trace) Printer.trace("> PortMixerPort: open");
// reserve mixer resources for this line
mixer.open(this);
try {
// open the line. may throw LineUnavailableException.
implOpen();
// if we succeeded, set the open state to true and send events
setOpen(true);
} catch (LineUnavailableException e) {
// release mixer resources for this line and then throw the exception
mixer.close(this);
throw e;
}
if (Printer.trace) Printer.trace("< PortMixerPort: open succeeded");
}
}
}

public void open() throws LineUnavailableException {
synchronized (mixer) {
// if the line is not currently open, try to open it with this format and buffer size
if (!isOpen()) {
if (Printer.trace) Printer.trace("> PortMixerPort: open");
// reserve mixer resources for this line
mixer.open(this);
try {
// open the line. may throw LineUnavailableException.
implOpen();
// if we succeeded, set the open state to true and send events
setOpen(true);
} catch (LineUnavailableException e) {
// release mixer resources for this line and then throw the exception
mixer.close(this);
throw e;
}
if (Printer.trace) Printer.trace("< PortMixerPort: open succeeded");
}
}
}