Examples of Voice


Examples of com.sun.speech.freetts.Voice

    public static void listAllVoices() {
        System.out.println();
        System.out.println("All voices available:");
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice voices[] = voiceManager.getVoices();
        for (int i = 0; i < voices.length; i++)
            System.out.println("    " + voices[i].getName() + " (" + voices[i].getDomain() + " domain)");

    }
View Full Code Here

Examples of com.sun.speech.freetts.Voice

    public static void main(String args[]) {
        listAllVoices();
        System.out.println();
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice("kevin16");
        if (helloVoice == null) {
            System.exit(1);
        }
        helloVoice.allocate();
        helloVoice.speak("all over the world, you can see");
        helloVoice.deallocate();
        System.exit(0);
    }
View Full Code Here

Examples of com.sun.speech.freetts.Voice

    System.out.println("使用声音: " + voiceName);

    /* The VoiceManager manages all the voices for FreeTTS.
     */
    VoiceManager voiceManager = VoiceManager.getInstance();
    Voice helloVoice = voiceManager.getVoice(voiceName);

    if (helloVoice == null) {
      System.err.println( "找不到你所指定的声音. "  + voiceName + "请选择另一种.");
      System.exit(1);
    }

    /* Allocates the resources for the voice.
     */
    helloVoice.allocate();
    Locale a = helloVoice.getLocale();
    System.out.println(a.getLanguage());
    /* Synthesize speech.
     */
    helloVoice.speak(textTo);
    /* Clean up and leave.
     */
    helloVoice.deallocate();

  }
View Full Code Here

Examples of com.sun.speech.freetts.Voice

        System.out.println("Using voice: " + voiceName);

    /* The VoiceManager manages all the voices for FreeTTS.
    */
        VoiceManager voiceManager = VoiceManager.getInstance();
        Voice helloVoice = voiceManager.getVoice(voiceName);

        if (helloVoice == null) {
            System.err.println(
                    "Cannot find a voice named "
                            + voiceName + ".  Please specify a different voice.");
            System.exit(1);
        }
   
    /* Allocates the resources for the voice.
    */
        helloVoice.allocate();
   
    /* Synthesize speech.
    */
//     helloVoice.speak("Thank you for giving me a voice. "
//             + "I'm so glad to say hello to this world.");
        helloVoice.speak("How much wood could a woodchuck chuck if a woodchuck could chuck wood?");
        helloVoice.speak("The RDF Schema vocabulary (RDFS)");

    /* Clean up and leave.
    */
        helloVoice.deallocate();
        System.exit(0);
    }
View Full Code Here

Examples of com.sun.speech.freetts.Voice

   
    if(voiceName==null) {
      voiceName = "kevin16";
    }

    Voice voice = voices.get(voiceName);

    if(voice!=null) {
      if(!voice.isLoaded()) {
        voice.allocate();
      }
      voice.speak(text);
    } else {
      logger.error("Could not find voice: " + voiceName);
      StringBuilder sb = new StringBuilder();
      if(logger.isInfoEnabled()) {
        for(String name : voices.keySet()) {
View Full Code Here

Examples of instantbach.data.chord.Voice

     * Adds the given voice of the givne note numeric value to this template
     * @param position NotePosition
     * @param numeric int
     */
    public void addVoice(NotePosition position, int numeric) {
        Voice voice = new Voice(position, new Note(numeric));
        list.add(voice);
    }
View Full Code Here

Examples of instantbach.data.chord.Voice

     * @param index int
     * @return int
     */
    public int getNoteNumeric(int index) {
        if (index > -1 && index < size()) {
            Voice voice = list.get(index);
            return voice.getNoteNumeric();
        } else
            return -1;
    }
View Full Code Here

Examples of instantbach.data.chord.Voice

                if (i != progression.size() - 1) {
                    chordArray[i] = compareChords(allChords, chordArray[i + 1]);
                } else {

                    //create prefered last chord (For cadence)
                    Voice bassVoice = new Voice(NotePosition.ROOT, new Note("C2"));
                    Voice tenorVoice = new Voice(NotePosition.FIFTH, new Note("G2"));
                    Voice altoVoice = new Voice(NotePosition.THIRD, new Note("E3"));
                    Voice sopranoVoice = new Voice(NotePosition.ROOT, new Note("C4"));

                    //if the last chord is I....
                    if (progression.getIdentifier(i).equals("I")) {
                        chordArray[i] = new Chord("I", bassVoice, tenorVoice, altoVoice, sopranoVoice);
                        parent.appendInfo("\r\n");
View Full Code Here

Examples of instantbach.data.chord.Voice

        for (int i = 0; i < fullSpectrum.size(); i++) {

            //put chord members within in range into appropriate vectors
            int value = fullSpectrum.getNoteNumeric(i);

            Voice voice = fullSpectrum.getVoice(i);

            if ((value >= 4) && (value <= 24))
                bassVector.add(voice);
            if ((value >= 12) && (value <= 31))
                tenorVector.add(voice);
View Full Code Here

Examples of instantbach.data.chord.Voice

        //the symbol is the same for each chord in this method
        String symbol = chord.getSymbol();

        boolean proceed = true;

        Voice bass = chord.getVoice(VoiceType.BASS);
        Voice tenor = chord.getVoice(VoiceType.TENOR);
        Voice alto = chord.getVoice(VoiceType.ALTO);
        Voice soprano = chord.getVoice(VoiceType.SOPRANO);

        int root = 0;
        int third = 0;
        int fifth = 0;
        int seventh = 0;

        ArrayList<Voice> voiceList = new ArrayList<Voice>();
        voiceList.add(bass);
        voiceList.add(tenor);
        voiceList.add(alto);
        voiceList.add(soprano);

        for (int i = 0; i < voiceList.size(); i++) {
            Voice voice = voiceList.get(i);
            NotePosition position = voice.getPosition();
            switch (position) {
            case ROOT:
                root++;
                break;
            case THIRD:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.