Thursday, January 3, 2013

Text to speech using java api voice part 1

Hello Friends,

Please read my previous post before using it
We know that there are a number of objects that work together java to perform speech synthesis. One of them is voice.


The Voice is the central processing point for FreeTTS. The Voice takes as input a FreeTTSSpeakable, translates the text associated with the FreeTTSSpeakable into speech and generates audio output corresponding to that speech. Read more.....


The VoiceManager class is the central repository of voices available to FreeTTS. You can use this sample code to get available voice list.
source code:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tts;
import com.sun.speech.freetts.Voice;
import com.sun.speech.freetts.VoiceManager;

/**
 *
 * @author sandy
 */
public class voicelist {
    public static void main(String arg[])
    {
        VoiceManager voicemgr   =   VoiceManager.getInstance();// get all availiable voice
        Voice[] voice   =   voicemgr.getVoices();
        for(int i=0; i<voice.length; i++)
        {
            System.out.println(voice[i].getName());
           
        }
       
    }
   
}



No comments:

Post a Comment