class Jsapi10SynthesizedOutput implements SynthesizedOutput, SpeakableListener,
        StreamableSynthesizedOutput {

    @Override
    public void waitNonBargeInPlayed() {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("waiting until all non-barge-in has been played...");
        }
        if (!bargein) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("bargein not active for current output");
            }
            return;
        }
        boolean stopWaiting = false;
        while (!stopWaiting) {
            synchronized (endplayLock) {
                try {
                    endplayLock.wait(WAIT_EMPTY_TIMEINTERVALL);
                } catch (InterruptedException e) {
                    return;
                }
            }
            synchronized (queuedSpeakables) {
                if (queuedSpeakables.isEmpty()) {
                    stopWaiting = true;
                } else {
                    final SpeakableText speakable = queuedSpeakables.peek();
                    if (speakable instanceof SpeakableSsmlText) {
                        final SpeakableSsmlText ssml = (SpeakableSsmlText) speakable;
                        stopWaiting = ssml.getBargeInType() == null;
                    }
                }
            }
        }
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("...all non barge-in has been played");
        }
    }

    public  Jsapi10SynthesizedOutput(final SynthesizerModeDesc defaultDescriptor);

}