Package org.sodbeans.phonemic.tts

Examples of org.sodbeans.phonemic.tts.TextToSpeechEngine


    private final String SPEECH_DISPATCHER_READABLE_NAME = "Speech Dispatcher";
   
    public void actionPerformed(ActionEvent e) {
        boolean changed = false;
        Iterator<TextToSpeechEngine> engines = speech.getAvailableEngines();
        TextToSpeechEngine firstEngine = engines.next();
        TextToSpeechEngine currentEngine = firstEngine;
        TextToSpeechEngine newEngine = firstEngine;
       
        // Loop through, find the current voice (if found) and set to next voice.
        // If the current voice couldn't be found, set it to the first one we find.
        TextToSpeechEngine eng = speech.getTextToSpeechEngine();
       
        if (eng != null) {
            boolean found = false;
            while (engines.hasNext() && !changed) {
                if (eng == currentEngine) {
View Full Code Here


        boolean speaking = NbPreferences.forModule(TextToSpeechPanel.class).getBoolean(TextToSpeechOptions.SPEECH_ENABLED, true);
        setSpeakingVisually(speaking);

        // Fill out the "engines" combo box.
        Iterator<TextToSpeechEngine> engines = speech.getAvailableEngines();
        TextToSpeechEngine currentEngine = speech.getTextToSpeechEngine();
        DefaultComboBoxModel oldModel = (DefaultComboBoxModel) enginesComboBox.getModel();
        oldModel.removeAllElements();
        int i = 0;
       
        while(engines.hasNext()) {
            TextToSpeechEngine next = engines.next();
           
            if ((next == TextToSpeechEngine.JAWS && !TextToSpeechFactory.jawsScriptExists(SODBEANS_SCRIPT_NAME))
                    || (next == TextToSpeechEngine.NVDA && !TextToSpeechFactory.nvdaScriptExists(SODBEANS_SCRIPT_NAME))
                    || (next != TextToSpeechEngine.JAWS && next != TextToSpeechEngine.NVDA))
            {
                oldModel.addElement(lookupEngineObject(next));
           
                if (currentEngine.equals(next)) {
                    enginesComboBox.setSelectedIndex(i);
                }
                i++;
            }
        }
       
        // Fill in the "available voices" combobox.
        populateVoices();
        Iterator<SpeechVoice> voices = speech.getAvailableVoices();
        SpeechVoice currentVoice = speech.getCurrentVoice();
        voiceComboBox.setSelectedIndex(0); // Select default voice first.
       
        if (currentVoice != null) {
            i = 0;
            while(voices.hasNext()) {
                SpeechVoice next = voices.next();
                if(currentVoice.getName().equals(next.getName())) {
                    voiceComboBox.setSelectedIndex(i);
                }
                i++;
            }
        }
View Full Code Here

TOP

Related Classes of org.sodbeans.phonemic.tts.TextToSpeechEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.