Output The freetts pronunciation to the external file use freetts to generate a wave file

Source: Internet
Author: User

The original post in this: http://sourceforge.net/projects/freetts/forums/forum/137669/topic/1166875

To make it easier for you to see, you can simply give the key things to you. Save yourself half a day, hey

The source code is as follows:

public static void main(String[] args) throws InstantiationException {System.setProperty("com.sun.speech.freetts.voice.defaultAudioPlayer", "com.sun.speech.freetts.audio.SingleFileAudioPlayer"); SingleFileAudioPlayer sfap;System.out.println("Using voice: " + "kevin16");     /* The VoiceManager manages all the voices for FreeTTS. */VoiceManager voiceManager = VoiceManager.getInstance();Voice helloVoice = voiceManager.getVoice("kevin16");if (helloVoice == null) {System.err.println("Cannot find a voice named "+ "kevin16" + ".  Please specify a different voice.");System.exit(1);}     /* Allocates the resources for the voice. */helloVoice.allocate();sfap = (SingleFileAudioPlayer)helloVoice.getDefaultAudioPlayer();helloVoice.setAudioPlayer(sfap);helloVoice.speak("Thank you for giving me a voice. "                      + "I'm so glad to say hello to this world.");sfap.close();//write data to file at here./* Clean up and leave. */helloVoice.deallocate();System.exit(0);}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.