Skip to content

Harium/espeak-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-espeak

Simple espeak java wrapper, no JNI, no native libraries, no headache.

You should install espeak to use this wrapper!

Minimal Example

Espeak espeak = new Espeak();
espeak.speak("Hello World!");

Example using voice

Voice manVoice = new Voice();
manVoice.setName("en-us");
manVoice.setAmplitude(100);
manVoice.setPitch(30);
manVoice.setSpeed(100);
manVoice.setVariant(true, 3);

Espeak man = new Espeak(manVoice);
man.speak("Hello World!");

Example foreign voice

Voice chineseVoice = new Voice();
chineseVoice.setName("zh");
chineseVoice.setAmplitude(100);
chineseVoice.setPitch(30);
chineseVoice.setSpeed(100);
chineseVoice.setVariant("f2");

Espeak woman = new Espeak(chineseVoice);
woman.speak("Nǐ hǎo, shìjiè!");

Maven

<dependency>
    <groupId>com.harium.hci</groupId>
    <artifactId>espeak</artifactId>
    <version>1.0.3</version>
</dependency>

How it works

This library calls espeak via Process. Everytime you call to Espeak.speak it creates a new thread to execute the process.

Thanks to