List of usage examples for javax.sound.sampled LineUnavailableException LineUnavailableException
public LineUnavailableException()
From source file:com.amazon.alexa.avs.AVSController.java
private InputStream getMicrophoneInputStream(AVSController controller, RecordingRMSListener rmsListener) throws LineUnavailableException, IOException { int numberRetries = 1; if (this.wakeWordAgentEnabled) { numberRetries = WAKE_WORD_RELEASE_TRIES; }//from ww w .ja v a2 s .co m for (; numberRetries > 0; numberRetries--) { try { return microphone.getAudioInputStream(controller, rmsListener); } catch (LineUnavailableException | IOException e) { if (numberRetries == 1) { throw e; } log.warn("Could not open the microphone line."); try { Thread.sleep(WAKE_WORD_RELEASE_RETRY_DELAY_MS); } catch (InterruptedException e1) { log.error("exception:", e1); } } } throw new LineUnavailableException(); }