Results 1 to 4 of 4
Thread: Text to Speech,help me
- 09-09-2012, 05:23 AM #1
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Text to Speech,help me
This a my code
When run , I want to return for me a file mp3 but haven't done.Can you help mePHP Code:Synthesizer suynth = Central.createSynthesizer(new SynthesizerModeDesc(Locale.ENGLISH)); suynth.allocate(); suynth.resume(); suynth.speakPlainText("Hello", null); suynth.waitEngineState(Synthesizer.QUEUE_EMPTY); suynth.deallocate();
Thank you very muck
- 09-09-2012, 09:09 AM #2
Re: Text to Speech,help me
Is Central the name of a class, or is it a badly named variable? There's no such class in the standard JDK.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 09-09-2012, 09:34 AM #3
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
- 09-16-2012, 05:59 AM #4
Member
- Join Date
- Sep 2012
- Posts
- 3
- Rep Power
- 0
Re: Text to Speech,help me
Thank you,I have had a good solution.Below is my fuction
public void toWavFile(String text, String fileName) {
try {
CGAudioManager audioMan = (CGAudioManager) synth.getAudioManager();
AudioFormat audioFomat = audioMan.getAudioFormat();
AudioFileFormat afm = new AudioFileFormat(AudioFileFormat.Type.WAVE, audioFomat, AudioSystem.NOT_SPECIFIED);
AudioFileSink sink = new AudioFileSink(new File(fileName + ".wav"), afm);
new AudioFormatConverter(audioMan, sink, true);
audioMan.startSending();
synth.speakPlainText(text, null);
synth.waitEngineState(Synthesizer.QUEUE_EMPTY);
audioMan.closeOutput();
sink.drain();
} catch (InterruptedException ex) {
Logger.getLogger(TextToSpeech.class.getName()).log (Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(TextToSpeech.class.getName()).log (Level.SEVERE, null, ex);
} catch (EngineStateError ex) {
Logger.getLogger(TextToSpeech.class.getName()).log (Level.SEVERE, null, ex);
} catch (IllegalArgumentException ex) {
Logger.getLogger(TextToSpeech.class.getName()).log (Level.SEVERE, null, ex);
}
}Last edited by kienkun1990; 09-16-2012 at 03:56 PM.
Similar Threads
-
Speech To Text
By jyothi.priyanka in forum Advanced JavaReplies: 1Last Post: 12-04-2011, 11:44 AM -
text to speech conversioin using freeTTs
By yonas in forum New To JavaReplies: 3Last Post: 05-24-2011, 04:58 PM -
Text To Speech
By jyothi.priyanka in forum Advanced JavaReplies: 0Last Post: 02-24-2011, 05:00 PM -
speech to text concersion
By ak88 in forum Advanced JavaReplies: 1Last Post: 03-09-2010, 08:57 AM -
Capture speech and convert it to text in a textbox
By Cyber Dragon in forum Advanced JavaReplies: 1Last Post: 04-25-2009, 04:55 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks