public class SoundSynthHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
INIT_ATTEMPTS_MAX_COUNT |
private static java.util.concurrent.Semaphore |
initializedSemaphore |
private static MaryInterface |
marytts |
Constructor and Description |
---|
SoundSynthHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
initialize()
Perform initialization.
|
static void |
say(java.lang.String text)
Synthesize and say immediately.
|
static byte[] |
synthesize(java.lang.String text)
Prepare sound from text
|
static void |
waitUntilInitialized()
Wait for initialization to complete.
|
private static final int INIT_ATTEMPTS_MAX_COUNT
private static MaryInterface marytts
private static java.util.concurrent.Semaphore initializedSemaphore
public static void initialize()
public static void waitUntilInitialized() throws java.lang.InterruptedException
java.lang.InterruptedException
public static byte[] synthesize(java.lang.String text)
text
- will be converted into soundAudioSystem.getAudioFileFormat(java.io.InputStream)
(after
wrapping in ByteArrayInputStream
)public static void say(java.lang.String text)
Layer1ApiSoundAlertMessage
and
synthesize(String)
instead (this will prevent overlapping, for
example)text
- will be converted into sound