/** {@inheritDoc} It creates the MaryClient and starts the synthesisQueue thread. */ @Override public void connect(final ConnectionInformation info) throws IOException { processor = MaryClient.getMaryClient(); synthesisQueue = new SynthesisQueue(this); synthesisQueue.addListener(this); synthesisQueue.setProcessor(processor); synthesisQueue.setRequestParameters(maryRequestParameters); synthesisQueue.start(); }
/** {@inheritDoc} */ @Override public void passivate() { if (LOGGER.isDebugEnabled()) { LOGGER.debug("passivating output..."); } // Clear all lists and reset the flags. listener.clear(); if (synthesisQueue != null) { synthesisQueue.clearQueue(); synthesisQueue.interrupt(); synthesisQueue = null; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("...passivated output"); } }
/** * {@inheritDoc} The queueSpeakable method simply offers a speakable to the queue. it notifies the * synthesisQueue Thread and then it returns * * @throws NoresourceError if no MaryClient has been created */ @Override public void queueSpeakable( final SpeakableText speakable, final String sessionId, final DocumentServer server) throws NoresourceError { if (processor == null) { throw new NoresourceError("no synthesizer: cannot speak"); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("queued speakable: " + speakable); } synthesisQueue.queueSpeakables(speakable); speakableQueueEmpty = false; }
/** * Stops the currently playing Audio. * * @throws NoresourceError . */ public void cancelAudioOutput() throws NoresourceError { synthesisQueue.cancelAudioOutput(); }
/** {@inheritDoc} */ @Override public void cancelOutput() { synthesisQueue.cancelOutput(); }