MarySynthesizedOutput implements SynthesizedOutput, SynthesizedOutputListener { @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; } MarySynthesizedOutput(); @Override void queueSpeakable(final SpeakableText speakable,
            final String sessionId, final DocumentServer server); @Override void waitNonBargeInPlayed(); @Override void waitQueueEmpty(); @Override void activate(); @Override void close(); @Override String getType(); @Override void open(); @Override void passivate(); @Override void connect(final ConnectionInformation info); @Override void disconnect(final ConnectionInformation info); @Override void cancelOutput(final BargeInType bargeInType); boolean supportsBargeIn(); @Override void addListener(final SynthesizedOutputListener outputListener); @Override void removeListener(final SynthesizedOutputListener outputListener); void setType(final String resourceType); void outputStatusChanged(final SynthesizedOutputEvent event); @Override boolean isBusy(); void cancelAudioOutput(); void setAudioType(final String value); void setVoiceName(final String name); void setLang(final String lang); @Override void outputError(final ErrorEvent error);  }
@Test public void testQueueSpeakable() throws Exception, JVoiceXMLEvent { final SsmlDocument doc = new SsmlDocument(); final Speak speak = doc.getSpeak(); speak.setXmlLang(Locale.US); speak.addText("hello from an SSML document"); final SpeakableSsmlText ssml = new SpeakableSsmlText(doc); output.queueSpeakable(ssml, sessionId, documentServer); synchronized (outputEndedLock) { outputEndedLock.wait(); } }