com.octo.captcha.component.sound.wordtosound
Class FreeTTSWordToSound
java.lang.Object
com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
com.octo.captcha.component.sound.wordtosound.FreeTTSWordToSound
- All Implemented Interfaces:
- WordToSound
public class FreeTTSWordToSound
- extends AbstractWordToSound
- implements WordToSound
WordToSound implementation with FreeTTS an openSource Text To Speech implementation.
Constructor Summary |
FreeTTSWordToSound(SoundConfigurator configurator,
int minAcceptedWordLength,
int maxAcceptedWordLength)
Constructor for a FreeTTS implmentation of WordToSound. |
Method Summary |
protected javax.sound.sampled.AudioInputStream |
addEffects(javax.sound.sampled.AudioInputStream sound)
Add effect to the sound |
javax.sound.sampled.AudioInputStream |
getSound(java.lang.String word)
Main method for this service Return a sound with the specified word |
javax.sound.sampled.AudioInputStream |
getSound(java.lang.String word,
java.util.Locale locale)
Main method for this service Return a sound with the specified word and Locale, depending on the local a sound is
not the same. |
javax.sound.sampled.AudioInputStream |
stringToSound(java.lang.String sentence)
Main method for this service Return an image with the specified. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
defaultVoiceName
public static java.lang.String defaultVoiceName
defaultVoicePackage
public static java.lang.String defaultVoicePackage
FreeTTSWordToSound
public FreeTTSWordToSound(SoundConfigurator configurator,
int minAcceptedWordLength,
int maxAcceptedWordLength)
- Constructor for a FreeTTS implmentation of WordToSound. This constructor imply that WordToSound only use one
voice define by voiceName, with its own locale
- Parameters:
minAcceptedWordLength
- Length Minimal of generated wordsmaxAcceptedWordLength
- Length Maximal of generated words
getSound
public javax.sound.sampled.AudioInputStream getSound(java.lang.String word)
throws CaptchaException
- Description copied from interface:
WordToSound
- Main method for this service Return a sound with the specified word
- Specified by:
getSound
in interface WordToSound
- Parameters:
word
- The word to tranform into sound
- Returns:
- the generated sound
- Throws:
CaptchaException
- if word is invalid or an exception occurs during the sound generation- See Also:
WordToSound.getSound(java.lang.String)
getSound
public javax.sound.sampled.AudioInputStream getSound(java.lang.String word,
java.util.Locale locale)
throws CaptchaException
- Description copied from interface:
WordToSound
- Main method for this service Return a sound with the specified word and Locale, depending on the local a sound is
not the same. This is a big difference with an image.
- Specified by:
getSound
in interface WordToSound
- Parameters:
word
- The word to tranform into soundlocale
- Locale for the sound
- Returns:
- the generated sound
- Throws:
CaptchaException
- if word is invalid or an exception occurs during the sound generation- See Also:
WordToSound.getSound(String, java.util.Locale)
addEffects
protected javax.sound.sampled.AudioInputStream addEffects(javax.sound.sampled.AudioInputStream sound)
- Description copied from class:
AbstractWordToSound
- Add effect to the sound
- Specified by:
addEffects
in class AbstractWordToSound
- Parameters:
sound
- The sound to modify
- Returns:
- The modified sound.
- See Also:
AbstractFreeTTSWordToSound.addEffects(javax.sound.sampled.AudioInputStream)
stringToSound
public javax.sound.sampled.AudioInputStream stringToSound(java.lang.String sentence)
throws CaptchaException
- Main method for this service Return an image with the specified. Synchronisation is very important, for multi
threading execution
- Parameters:
sentence
- Written sentece to transform into speech
- Returns:
- the generated sound
- Throws:
CaptchaException
- if word is invalid or an exception occurs during the sound generation
Copyright 2003-2009 JCaptcha. All Rights Reserved.