Package org.sodbeans.phonemic

Examples of org.sodbeans.phonemic.SpeechVoice


        // Parse lines of input until we get a blank line.
        String line = "";
        do {
            try {
                line = this.input.readLine();
                SpeechVoice v = new SpeechVoice(line, SpeechLanguage.ENGLISH_US);
                voices.add(v);
            } catch (IOException ex) {
                Logger.getLogger(ClientSpeak.class.getName()).log(Level.SEVERE, null, ex);
                line = "";
            }
View Full Code Here


    public SpeechVoice getCurrentVoice() {
        sendRawMessage("getCurrentVoice");
       
        String name = getStringResponse();
       
        return new SpeechVoice(name, SpeechLanguage.ENGLISH_US);
    }
View Full Code Here

        if(speech != null) {
            speech.reinitialize();
           
            // Reload all user settings.
            // TODO: actually reload all user settings.
            SpeechVoice currentVoice = speech.getCurrentVoice();
            if(TextToSpeechOptions.isScreenReading()) {
                if(currentVoice != null) {
                    speech.speak("Speech engine reset. The current voice is now " + currentVoice.getName());
                }
                else {
                    speech.speak("Speech engine reset");
                }
            }
View Full Code Here

                speech.speak("Text to Speech voice was not changed, as there are no alternative voices.");
            }
            return;
        }
       
        SpeechVoice firstVoice = voices.next();
        SpeechVoice currentVoice = firstVoice;
        SpeechVoice newVoice = firstVoice;
       
        // 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.
        SpeechVoice v = speech.getCurrentVoice();
       
        if (v != null) {
            boolean found = false;
            while (voices.hasNext() && !found) {
                if (v.getName().equals(currentVoice.getName())) {
                    if (voices.hasNext())
                        newVoice = voices.next();
                    found = true;
                }
                if (voices.hasNext())
View Full Code Here

        // Populate the voices combo box.
        DefaultComboBoxModel oldModel = (DefaultComboBoxModel) voiceComboBox.getModel();
        oldModel.removeAllElements();
       
        // Put the "system default voice" option at the top.
        SpeechVoice defaultVoice = new SpeechVoice(DEFAULT_TTS_VOICE_NAME, SpeechLanguage.ENGLISH_US);
        oldModel.addElement(defaultVoice);       
       
        while(voices.hasNext()) {
            SpeechVoice next = voices.next();
            oldModel.addElement(next);
        }
    }
View Full Code Here

        }
       
        // 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

        // Reinitialize speech and set options as appropriate.
        if (!name.equals(DEFAULT_TTS_VOICE_NAME)) {
            NbPreferences.forModule(TextToSpeechPanel.class).put(TextToSpeechOptions.SELECTED_VOICE, name);

            // Set the voice to this.
            speech.setVoice(new SpeechVoice(name, SpeechLanguage.ENGLISH_US));
        }
        else
        {
            // A blank string means use the default.
            NbPreferences.forModule(TextToSpeechPanel.class).put(TextToSpeechOptions.SELECTED_VOICE, "");
View Full Code Here

        // Set the voice, if it is set in preferences.
        String voice = TextToSpeechOptions.getSelectedVoice();

        if (!voice.equals("")) {
            speech.setVoice(new SpeechVoice(voice, SpeechLanguage.ENGLISH_US));
        }

        // Set the volume, speed and pitch.
        speech.setVolume((double) TextToSpeechOptions.getSpeechVolume() / 100.0);
        speech.setSpeed((double) TextToSpeechOptions.getSpeechSpeed() / 100.0);
View Full Code Here

TOP

Related Classes of org.sodbeans.phonemic.SpeechVoice

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.