Fairy new to programming, 2nd post here. I'm attempting to make a personal project that takes an article(like a reddit article) and saves it to an mp3 or wav file that can be burned to a CD and listened to. I am using the java JSoup library to grab the paragraph elements from the article and save them to a .txt file, which is working. I am also using java swing with freetts(currently in a separate project) to convert text to speech, which is also working. My best guess as to the next step is to get the freetts to save the text to an audio file. Im trying to use a method called dumpAudio that i found on the freetts site, and i cant get it to work. So my question is,what am i doing wrong?
Here is my attempt at this(i only included the freetts code for brevity):
public class MyRedditProject extends javax.swing.JFrame {
// code is from https://www.youtube.com/watch?v=swuYhvwHw9w
/**
* Creates new form RedditProject
*/
public MyRedditProject() {
initComponents();
}
@SuppressWarnings("unchecked")
private static final String VOICENAME = "kevin16";
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Voice voice;
VoiceManager vm = VoiceManager.getInstance();
voice = vm.getVoice(VOICENAME);
voice.allocate();
try
{
voice.speak(jTextArea1.getText());
//trying to use dumpAudio to save text to audio file. I found the
//dumpAudio method on the freetts site
vm.dumpAudio("C:\\Users\\david\\Documents\\Reddit_Project\\dumpAudio.wav");
}
catch(Exception e)
{
}