Package com.sun.speech.freetts.audio

Examples of com.sun.speech.freetts.audio.SingleFileAudioPlayer


                if (type != null) {
                    if (multiAudio) {
                        audioPlayer = new MultiFileAudioPlayer(
                                getBasename(audioFile), type);
                    } else
                        audioPlayer = new SingleFileAudioPlayer(
                                getBasename(audioFile), type);
                } else {
                    try {
                        audioPlayer = new RawFileAudioPlayer(audioFile);
                    } catch (IOException ioe) {
View Full Code Here


                AudioFileFormat.Type type = PlayerModel.getAudioType(audioFile);
               
                com.sun.speech.freetts.Voice freettsVoice =
                        ((com.sun.speech.freetts.jsapi.FreeTTSVoice) jsapiVoice).getVoice();
               
                SingleFileAudioPlayer player = new SingleFileAudioPlayer(PlayerModel.getBasename(audioFile), type);
                freettsVoice.setAudioPlayer(player);

                freettsVoice.startBatch();
                if (!freettsVoice.speak(text)) {
                    JOptionPane.showMessageDialog(null, "Sorry, the application unable to convert your text into sound file!", "Failed to convert to Sound", JOptionPane.ERROR_MESSAGE);
                }
                freettsVoice.endBatch();
                player.close();
  
                freettsVoice.setAudioPlayer(new com.sun.speech.freetts.audio.JavaStreamingAudioPlayer()  );
       }
       String finishMsg = "Your sound file have saved to "+audioFile;
       JOptionPane.showMessageDialog(null,finishMsg, "Done Export sound file", JOptionPane.ERROR_MESSAGE);
View Full Code Here

TOP

Related Classes of com.sun.speech.freetts.audio.SingleFileAudioPlayer

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.