JeSpeak is a Java library that bridges eSpeak, which is a compact open source software speech synthesizer. JeSpeak uses JNI to make native call to libespeak.
After some feedbacks from jonsd (eSpeak project admin) I released jespeak-0.2-alpha, a new alpha version with 2 new methods:
listVoiceNames() : to list available voices
setVoiceByName() : to actually set the current voice
Feedbacks are always welcome!
The JeSpeak project just started.
I have released an alpha version for testing.
As soon as I have feedbacks, I will add features to the project.
Create and compile this class:
import com.jespeak.*;
public class JeSpeakTest {
public static void main(String[] args) {
// get a JeSpeak instance
JeSpeak jeSpeak = JeSpeak.getInstance();
// submit the 'Test 1' string to be spoken
jeSpeak.synthesize("Test 1\n");
// the isPlaying method returns true
assert jeSpeak.isPlaying() == true;
// submit the 'Test 2' string to be spoken
jeSpeak.synthesize("Test 2\n");
// this method returns only when everything is spoken
jeSpeak.synchronize();
// the isPlaying method returns false now
assert jeSpeak.isPlaying() == false;
// submit the 'Test 3' string to be spoken
jeSpeak.synthesize("Test 3\n");
// stop and remove everything submited, so in this case 'Test 3' will immediately stop
jeSpeak.cancel();
// after a cancel, nothing is playing
assert jeSpeak.isPlaying() == false;
}
}
Put the .jar and the .so into the same dir and execute:
$ $JAVA_HOME/bin/java -Djava.library.path=. -cp . JeSpeakTest
If you have questions, bugs, feature request, etc. use thoses links (please in this order):
JeSpeak is released under the GNU General Public License.